- Electron version: 0.37.5
- Operating system: Windows 10

When calling a window's `webContents.downloadURL(URL)` method if the specified URL returns a 404 the `will-download` event on `webContents.session` does not fire and instead a dialog pops up asking the user to save an html file (the contents of the 404 page).

Is this expected behavior and is there any event I can listen to or some other way to get around this? I'd like to handle the error differently if possible.

Thanks

atom/browser/api/save_page_handler.h
}
namespace content {
class WebContents;
}
namespace atom {
namespace api {
class SavePageHandler : public content::DownloadManager::Observer,
                        public content::DownloadItem::Observer {
 public:
  using SavePageCallback = base::Callback<void(v8::Local<v8::Value>)>;
  SavePageHandler(content::WebContents* web_contents,
                  const SavePageCallback& callback);
  ~SavePageHandler();
  bool Handle(const base::FilePath& full_path,
              const content::SavePageType& save_type);
  static bool IsSavePageTypes(const std::string& type);
 private:
  void Destroy(content::DownloadItem* item);
  
  void OnDownloadCreated(content::DownloadManager* manager,
                         content::DownloadItem* item) override;
  
  void OnDownloadUpdated(content::DownloadItem* item) override;
  content::WebContents* web_contents_;  
  SavePageCallback callback_;
};
}  
}  
#endif