- 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/atom_api_session.cc
const net::ProxyConfig& config,
                  const base::Closure& callback) {
  auto proxy_service = getter->GetURLRequestContext()->proxy_service();
  proxy_service->ResetConfigService(make_scoped_ptr(
      new net::ProxyConfigServiceFixed(config)));
  
  proxy_service->ForceReloadProxyConfig();
  RunCallbackInUI(callback);
}
void ClearHostResolverCacheInIO(
    const scoped_refptr<net::URLRequestContextGetter>& context_getter,
    const base::Closure& callback) {
  auto request_context = context_getter->GetURLRequestContext();
  auto cache = request_context->host_resolver()->GetHostCache();
  if (cache) {
    cache->clear();
    DCHECK_EQ(0u, cache->size());
    if (!callback.is_null())
      RunCallbackInUI(callback);
  }
}
}  
Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)