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 22// FIXME: Move this header into the files that actually need it. 23#include "ExceptionCodeDescription.h" 24 25namespace WebCore { 26 27 // The DOM standards use unsigned short for exception codes. 28 // In our DOM implementation we use int instead, and use different 29 // numerical ranges for different types of DOM exception, so that 30 // an exception of any type can be expressed with a single integer. 31 typedef int ExceptionCode; 32 33 34 // Some of these are considered historical since they have been 35 // changed or removed from the specifications. 36 enum { 37 INDEX_SIZE_ERR = 1, 38 HIERARCHY_REQUEST_ERR = 3, 39 WRONG_DOCUMENT_ERR = 4, 40 INVALID_CHARACTER_ERR = 5, 41 NO_MODIFICATION_ALLOWED_ERR = 7, 42 NOT_FOUND_ERR = 8, 43 NOT_SUPPORTED_ERR = 9, 44 INUSE_ATTRIBUTE_ERR = 10, // Historical. Only used in setAttributeNode etc which have been removed from the DOM specs. 45 46 // Introduced in DOM Level 2: 47 INVALID_STATE_ERR = 11, 48 SYNTAX_ERR = 12, 49 INVALID_MODIFICATION_ERR = 13, 50 NAMESPACE_ERR = 14, 51 INVALID_ACCESS_ERR = 15, 52 53 // Introduced in DOM Level 3: 54 TYPE_MISMATCH_ERR = 17, // Historical; use TypeError instead 55 56 // XMLHttpRequest extension: 57 SECURITY_ERR = 18, 58 59 // Others introduced in HTML5: 60 NETWORK_ERR = 19, 61 ABORT_ERR = 20, 62 URL_MISMATCH_ERR = 21, 63 QUOTA_EXCEEDED_ERR = 22, 64 TIMEOUT_ERR = 23, 65 INVALID_NODE_TYPE_ERR = 24, 66 DATA_CLONE_ERR = 25, 67 68 // WebIDL exception types, handled by the binding layer. 69 // FIXME: Add GeneralError, EvalError, etc. when implemented in the bindings. 70 TypeError = 105, 71 }; 72 73} // namespace WebCore 74 75#endif // ExceptionCode_h 76