Skip to content

Instantly share code, notes, and snippets.

@roustem
Created December 3, 2020 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roustem/52483784a2837063bfeb6aa8f7d3a6eb to your computer and use it in GitHub Desktop.
Save roustem/52483784a2837063bfeb6aa8f7d3a6eb to your computer and use it in GitHub Desktop.
#[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothError {
Type(String),
Network,
NotFound,
NotSupported,
Security,
InvalidState,
}
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum WebGLError {
InvalidEnum,
InvalidFramebufferOperation,
InvalidOperation,
InvalidValue,
OutOfMemory,
ContextLost,
}
#[derive(Debug)]
pub enum PrefError {
NoSuchPref(String),
InvalidValue(String),
JsonParseErr(serde_json::error::Error),
}
#[derive(Serialize)]
enum Error {}
pub enum DecodeError {
InvalidDataUri,
NonBase64DataUri,
}
pub enum Error {
Io(io::Error),
Hyper(hyper::error::Error),
}
/// Errors returned to Blob URL Store request
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub enum BlobURLStoreError {
/// Invalid File UUID
InvalidFileID,
/// Invalid URL origin
InvalidOrigin,
/// Invalid entry content
InvalidEntry,
/// Invalid range
InvalidRange,
/// External error, from like file system, I/O etc.
External(String),
}
#[derive(Debug, Deserialize, Serialize)]
pub enum FileManagerThreadError {
/// The selection action is invalid due to exceptional reason
InvalidSelection,
/// The selection action is cancelled by user
UserCancelled,
/// Errors returned from file system request
FileSystemError(String),
/// Blob URL Store error
BlobURLStoreError(BlobURLStoreError),
}
/// Network errors that have to be exported out of the loaders
#[derive(Clone, Debug, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)]
pub enum NetworkError {
/// Could be any of the internal errors, like unsupported scheme, connection errors, etc.
Internal(String),
LoadCancelled,
/// SSL validation error that has to be handled in the HTML parser
SslValidation(String, Vec<u8>),
}
#[derive(Debug)]
pub enum TimeRangesError {
EndOlderThanStart,
OutOfRange,
}
/// DOM exceptions that can be thrown by a native DOM method.
#[derive(Clone, Debug, MallocSizeOf)]
pub enum Error {
/// IndexSizeError DOMException
IndexSize,
/// NotFoundError DOMException
NotFound,
/// HierarchyRequestError DOMException
HierarchyRequest,
/// WrongDocumentError DOMException
WrongDocument,
/// InvalidCharacterError DOMException
InvalidCharacter,
/// NotSupportedError DOMException
NotSupported,
/// InUseAttributeError DOMException
InUseAttribute,
/// InvalidStateError DOMException
InvalidState,
/// SyntaxError DOMException
Syntax,
/// NamespaceError DOMException
Namespace,
/// InvalidAccessError DOMException
InvalidAccess,
/// SecurityError DOMException
Security,
/// NetworkError DOMException
Network,
/// AbortError DOMException
Abort,
/// TimeoutError DOMException
Timeout,
/// InvalidNodeTypeError DOMException
InvalidNodeType,
/// DataCloneError DOMException
DataClone,
/// NoModificationAllowedError DOMException
NoModificationAllowed,
/// QuotaExceededError DOMException
QuotaExceeded,
/// TypeMismatchError DOMException
TypeMismatch,
/// InvalidModificationError DOMException
InvalidModification,
/// NotReadableError DOMException
NotReadable,
/// OperationError DOMException
Operation,
/// TypeError JavaScript Error
Type(String),
/// RangeError JavaScript Error
Range(String),
/// A JavaScript exception is already pending.
JSFailed,
}
/// The errors that the texImage* family of functions can generate.
#[derive(Debug)]
pub enum TexImageValidationError {
/// An invalid texture target was passed, it contains the invalid target.
InvalidTextureTarget(u32),
/// The passed texture target was not bound.
TextureTargetNotBound(u32),
/// Invalid texture dimensions were given.
InvalidCubicTextureDimensions,
/// A negative level was passed.
NegativeLevel,
/// A level too high to be allowed by the implementation was passed.
LevelTooHigh,
/// A level less than an allowed minimal value was passed.
LevelTooLow,
/// A depth less than an allowed minimal value was passed.
DepthTooLow,
/// A negative width and height was passed.
NegativeDimension,
/// A bigger with and height were passed than what the implementation
/// allows.
TextureTooBig,
/// An invalid data type was passed.
InvalidDataType,
/// An invalid texture format was passed.
InvalidTextureFormat,
/// Format did not match internal_format.
TextureFormatMismatch,
/// Invalid data type for the given format.
InvalidTypeForFormat,
/// Invalid border
InvalidBorder,
/// Expected a power of two texture.
NonPotTexture,
/// Unrecognized texture compression format.
InvalidCompressionFormat,
/// Invalid X/Y texture offset parameters.
InvalidOffsets,
}
/// Errors from executing a paint worklet
#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum PaintWorkletError {
/// Execution timed out.
Timeout,
/// No such worklet.
WorkletNotFound,
}
#[derive(Debug, Deserialize, Serialize)]
/// The kind of error the job promise should be rejected with.
pub enum JobError {
/// https://w3c.github.io/ServiceWorker/#reject-job-promise
TypeError,
/// https://w3c.github.io/ServiceWorker/#reject-job-promise
SecurityError,
}
#[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverCookieError {
InvalidDomain,
UnableToSetCookie,
}
#[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverJSError {
/// Occurs when handler received an event message for a layout channel that is not
/// associated with the current script thread
BrowsingContextNotFound,
JSError,
StaleElementReference,
Timeout,
UnknownType,
}
#[allow(missing_docs)]
pub enum RulesMutateError {
Syntax,
IndexSize,
HierarchyRequest,
InvalidState,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment