1# 2# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). 3# All rights reserved. 4# This file is distributed under the terms of the MIT License. 5# See the file 'LICENSE' in the root directory of the present 6# distribution, or http://opensource.org/licenses/MIT. 7# 8# @author Davide Brunato <brunato@sissa.it> 9# 10 11 12class XMLSchemaException(Exception): 13 """The base exception that let you catch all the errors generated by the library.""" 14 15 16class XMLSchemaOSError(XMLSchemaException, OSError): 17 pass 18 19 20class XMLSchemaAttributeError(XMLSchemaException, AttributeError): 21 pass 22 23 24class XMLSchemaTypeError(XMLSchemaException, TypeError): 25 pass 26 27 28class XMLSchemaValueError(XMLSchemaException, ValueError): 29 pass 30 31 32class XMLSchemaKeyError(XMLSchemaException, KeyError): 33 pass 34 35 36class XMLSchemaRuntimeError(XMLSchemaException, RuntimeError): 37 pass 38 39 40class XMLResourceError(XMLSchemaException, OSError): 41 """Raised when an error is found accessing an XML resource.""" 42 43 44class XMLSchemaNamespaceError(XMLSchemaException, RuntimeError): 45 """Raised when a wrong runtime condition is found with a namespace.""" 46 47 48class XMLSchemaWarning(Warning): 49 """Base warning class for the XMLSchema package.""" 50