Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | |
| 19 | #ifndef ExceptionCode_h |
| 20 | #define ExceptionCode_h |
| 21 | |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 22 | namespace WebCore { |
| 23 | |
| 24 | // The DOM standards use unsigned short for exception codes. |
| 25 | // In our DOM implementation we use int instead, and use different |
| 26 | // numerical ranges for different types of DOM exception, so that |
| 27 | // an exception of any type can be expressed with a single integer. |
| 28 | typedef int ExceptionCode; |
| 29 | |
Torne (Richard Coles) | 926b001 | 2013-03-28 15:32:48 +0000 | [diff] [blame] | 30 | |
| 31 | // Some of these are considered historical since they have been |
| 32 | // changed or removed from the specifications. |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 33 | enum { |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 34 | IndexSizeError = 1, |
| 35 | HierarchyRequestError, |
| 36 | WrongDocumentError, |
| 37 | InvalidCharacterError, |
| 38 | NoModificationAllowedError, |
| 39 | NotFoundError, |
| 40 | NotSupportedError, |
| 41 | InUseAttributeError, // Historical. Only used in setAttributeNode etc which have been removed from the DOM specs. |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 42 | |
| 43 | // Introduced in DOM Level 2: |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 44 | InvalidStateError, |
| 45 | SyntaxError, |
| 46 | InvalidModificationError, |
| 47 | NamespaceError, |
| 48 | InvalidAccessError, |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 49 | |
| 50 | // Introduced in DOM Level 3: |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 51 | TypeMismatchError, // Historical; use TypeError instead |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 52 | |
| 53 | // XMLHttpRequest extension: |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 54 | SecurityError, |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 55 | |
| 56 | // Others introduced in HTML5: |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 57 | NetworkError, |
| 58 | AbortError, |
| 59 | URLMismatchError, |
| 60 | QuotaExceededError, |
| 61 | TimeoutError, |
| 62 | InvalidNodeTypeError, |
| 63 | DataCloneError, |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 64 | |
| 65 | // These are IDB-specific. |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 66 | UnknownError, |
| 67 | ConstraintError, |
| 68 | DataError, |
| 69 | TransactionInactiveError, |
| 70 | ReadOnlyError, |
| 71 | VersionError, |
| 72 | |
| 73 | // File system |
Ben Murdoch | 0019e4e | 2013-07-18 11:57:54 +0100 | [diff] [blame] | 74 | NotReadableError, |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 75 | EncodingError, |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 76 | PathExistsError, |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 77 | |
| 78 | // SQL |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 79 | SQLDatabaseError, // Naming conflict with DatabaseError class. |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 80 | |
Torne (Richard Coles) | 926b001 | 2013-03-28 15:32:48 +0000 | [diff] [blame] | 81 | // WebIDL exception types, handled by the binding layer. |
| 82 | // FIXME: Add GeneralError, EvalError, etc. when implemented in the bindings. |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 83 | TypeError, |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | } // namespace WebCore |
| 87 | |
| 88 | #endif // ExceptionCode_h |