diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index a0b732338..2d098ff9c 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -2242,10 +2242,10 @@ void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult, MOZ_ASSERT(!aRv.Failed()); switch (aLoadResult) { - case NS_ERROR_FILE_NOT_FOUND: - case NS_ERROR_NOT_AVAILABLE: - case NS_ERROR_CORRUPTED_CONTENT: - aLoadResult = NS_ERROR_DOM_NETWORK_ERR; + case NS_ERROR_DOM_SECURITY_ERR: + case NS_ERROR_DOM_SYNTAX_ERR: + case NS_ERROR_DOM_NETWORK_ERR: + // These are OK, pass them through immediately. break; case NS_ERROR_MALFORMED_URI: @@ -2261,10 +2261,6 @@ void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult, // for this case, because that will make it impossible for consumers to // realize that our error was NS_BINDING_ABORTED. aRv.Throw(aLoadResult); - return; - - case NS_ERROR_DOM_SECURITY_ERR: - case NS_ERROR_DOM_SYNTAX_ERR: break; case NS_ERROR_DOM_BAD_URI: @@ -2272,15 +2268,15 @@ void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult, aLoadResult = NS_ERROR_DOM_SECURITY_ERR; break; + case NS_ERROR_FILE_NOT_FOUND: + case NS_ERROR_NOT_AVAILABLE: + case NS_ERROR_CORRUPTED_CONTENT: + // For lack of anything better, go ahead and throw a NetworkError here. + // We don't want to throw a JS exception, because for toplevel script + // loads that would get squelched. default: - // For lack of anything better, go ahead and throw a NetworkError here. - // We don't want to throw a JS exception, because for toplevel script - // loads that would get squelched. - aRv.ThrowDOMException(NS_ERROR_DOM_NETWORK_ERR, - nsPrintfCString("Failed to load worker script at %s (nsresult = 0x%x)", - NS_ConvertUTF16toUTF8(aScriptURL).get(), - aLoadResult)); - return; + aLoadResult = NS_ERROR_DOM_NETWORK_ERR; + break; } aRv.ThrowDOMException(aLoadResult,