ae72776312
These new exceptions have no legacy values. DataCloneError - The object can not be cloned. EncodingError - The encoding or decoding operation failed. NotReadableError - The input/output read operation failed UnknownError - The operation failed for an unknown transient reason (e.g. out of memory). ConstraintError - A mutation operation in a transaction failed because a constraint was not satisfied. DataError - Provided data is inadequate. TransactionInactiveError - A request was placed against a transaction which is currently not active, or which is finished. ReadOnlyError - The mutating operation was attempted in a "readonly" transaction. VersionError An attempt was made to open a database using a lower version than the existing version. OperationError - The operation failed for an operation-specific reason. NotAllowedError - The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. R=vsm@google.com Change-Id: I1245bc788fd287d566f42184ebe914165afa95ac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97163 Reviewed-by: Vijay Menon <vsm@google.com> Commit-Queue: Terry Lucas <terry@google.com>
55 lines
2.6 KiB
Plaintext
55 lines
2.6 KiB
Plaintext
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
part of $LIBRARYNAME;
|
|
|
|
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
|
|
|
|
static const String INDEX_SIZE = 'IndexSizeError';
|
|
static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
|
|
static const String WRONG_DOCUMENT = 'WrongDocumentError';
|
|
static const String INVALID_CHARACTER = 'InvalidCharacterError';
|
|
static const String NO_MODIFICATION_ALLOWED = 'NoModificationAllowedError';
|
|
static const String NOT_FOUND = 'NotFoundError';
|
|
static const String NOT_SUPPORTED = 'NotSupportedError';
|
|
static const String INVALID_STATE = 'InvalidStateError';
|
|
static const String SYNTAX = 'SyntaxError';
|
|
static const String INVALID_MODIFICATION = 'InvalidModificationError';
|
|
static const String NAMESPACE = 'NamespaceError';
|
|
static const String INVALID_ACCESS = 'InvalidAccessError';
|
|
static const String TYPE_MISMATCH = 'TypeMismatchError';
|
|
static const String SECURITY = 'SecurityError';
|
|
static const String NETWORK = 'NetworkError';
|
|
static const String ABORT = 'AbortError';
|
|
static const String URL_MISMATCH = 'URLMismatchError';
|
|
static const String QUOTA_EXCEEDED = 'QuotaExceededError';
|
|
static const String TIMEOUT = 'TimeoutError';
|
|
static const String INVALID_NODE_TYPE = 'InvalidNodeTypeError';
|
|
static const String DATA_CLONE = 'DataCloneError';
|
|
static const String ENCODING = 'EncodingError';
|
|
static const String NOT_READABLE = 'NotReadableError';
|
|
static const String UNKNOWN = 'UnknownError';
|
|
static const String CONSTRAINT = 'ConstraintError';
|
|
static const String TRANSACTION_INACTIVE = 'TransactionInactiveError';
|
|
static const String READ_ONLY = 'ReadOnlyError';
|
|
static const String VERSION = 'VersionError';
|
|
static const String OPERATION = 'OperationError';
|
|
static const String NOT_ALLOWED = 'NotAllowedError';
|
|
// Is TypeError class derived from DomException but name is 'TypeError'
|
|
static const String TYPE_ERROR = 'TypeError';
|
|
|
|
String get name {
|
|
var errorName = JS('String', '#.name', this);
|
|
// Although Safari nightly has updated the name to SecurityError, Safari 5
|
|
// and 6 still return SECURITY_ERR.
|
|
if (Device.isWebKit && errorName == 'SECURITY_ERR') return 'SecurityError';
|
|
// Chrome release still uses old string, remove this line when Chrome stable
|
|
// also prints out SyntaxError.
|
|
if (Device.isWebKit && errorName == 'SYNTAX_ERR') return 'SyntaxError';
|
|
return errorName;
|
|
}
|
|
$!MEMBERS
|
|
String toString() => JS('String', 'String(#)', this);
|
|
}
|