mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Refactor Error enum usage to consistently be qualified
This commit is contained in:
parent
94816bb3b4
commit
ba86131cd5
19 changed files with 139 additions and 161 deletions
|
@ -6,8 +6,7 @@ use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg};
|
|||
use dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
||||
use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods;
|
||||
use dom::bindings::codegen::InheritTypes::DedicatedWorkerGlobalScopeCast;
|
||||
use dom::bindings::error::Error::{JSFailed, Network, Syntax};
|
||||
use dom::bindings::error::{ErrorResult, Fallible, report_pending_exception};
|
||||
use dom::bindings::error::{Error, ErrorResult, Fallible, report_pending_exception};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{JS, MutNullableHeap, Root};
|
||||
use dom::bindings::utils::Reflectable;
|
||||
|
@ -177,13 +176,13 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
.parse(&url);
|
||||
match url {
|
||||
Ok(url) => urls.push(url),
|
||||
Err(_) => return Err(Syntax),
|
||||
Err(_) => return Err(Error::Syntax),
|
||||
};
|
||||
}
|
||||
|
||||
for url in urls {
|
||||
let (url, source) = match load_whole_resource(&self.resource_task, url) {
|
||||
Err(_) => return Err(Network),
|
||||
Err(_) => return Err(Error::Network),
|
||||
Ok((metadata, bytes)) => {
|
||||
(metadata.final_url, String::from_utf8(bytes).unwrap())
|
||||
}
|
||||
|
@ -194,7 +193,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
Ok(_) => (),
|
||||
Err(_) => {
|
||||
println!("evaluate_script failed");
|
||||
return Err(JSFailed);
|
||||
return Err(Error::JSFailed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue