Document error.rs.

This commit is contained in:
Ms2ger 2015-01-18 23:32:03 +01:00
parent 2a9acdcb73
commit ecf0317bc0

View file

@ -4,6 +4,8 @@
//! Utilities to throw exceptions from Rust bindings. //! Utilities to throw exceptions from Rust bindings.
#![deny(missing_docs)]
use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::conversions::ToJSValConvertible;
use dom::bindings::global::GlobalRef; use dom::bindings::global::GlobalRef;
use dom::domexception::DOMException; use dom::domexception::DOMException;
@ -21,22 +23,38 @@ use std::ptr;
/// DOM exceptions that can be thrown by a native DOM method. /// DOM exceptions that can be thrown by a native DOM method.
#[deriving(Show, Clone)] #[deriving(Show, Clone)]
pub enum Error { pub enum Error {
/// IndexSizeError
IndexSize, IndexSize,
FailureUnknown, /// NotFoundError
NotFound, NotFound,
/// HierarchyRequestError
HierarchyRequest, HierarchyRequest,
/// InvalidCharacterError
InvalidCharacter, InvalidCharacter,
/// NotSupportedError
NotSupported, NotSupported,
/// InvalidStateError
InvalidState, InvalidState,
/// SyntaxError
Syntax, Syntax,
/// NamespaceError
NamespaceError, NamespaceError,
/// InvalidAccessError
InvalidAccess, InvalidAccess,
/// SecurityError
Security, Security,
/// NetworkError
Network, Network,
/// AbortError
Abort, Abort,
/// TimeoutError
Timeout, Timeout,
/// DataCloneError
DataClone, DataClone,
NoModificationAllowedError /// NoModificationAllowedError
NoModificationAllowedError,
/// Unknown failure
FailureUnknown,
} }
/// The return type for IDL operations that can throw DOM exceptions. /// The return type for IDL operations that can throw DOM exceptions.