class InvalidSessionID(Exception): pass class InvalidCredentials(Exception): pass class InternalServerError(Exception): pass class InvalidTypeID(Exception): pass class InvalidUID(Exception): pass class NotAttachable(Exception): pass class InvalidZIP(Exception): pass class NotAPackage(Exception): pass class VocabularyMisuse(Exception): pass class XMLParseError(Exception): pass class QueryError(Exception): pass class InvalidAppUser(Exception): pass class AccessDenied(Exception): pass class InvalidAttachmentID(Exception): pass def getException(n): m = { 1:InvalidSessionID, 2:InvalidCredentials, 3:InternalServerError, 4:InvalidTypeID, 5:InvalidUID, 6:NotAttachable, 7:InvalidAppUser, 8:AccessDenied, 9:InvalidAttachmentID, 11:InvalidZIP, 12:NotAPackage, 13:VocabularyMisuse, 14:XMLParseError, 21:QueryError, 22:QueryError} return m[n]