|
| 1 | +GENERIC_MESSAGES = { |
| 2 | + BaseException: "A critical error occurred at the base exception level,", |
| 3 | + BaseExceptionGroup: "A group of exceptions was raised simultaneously,", |
| 4 | + Exception: "An unexpected error occurred,", |
| 5 | + GeneratorExit: "A generator was closed before completing,", |
| 6 | + KeyboardInterrupt: "Execution was stopped manually — usually by pressing Ctrl+C,", |
| 7 | + SystemExit: "The program was told to exit,", |
| 8 | + ArithmeticError: "A mathematical operation has gone wrong,", |
| 9 | + AssertionError: "An internal check failed — something unexpected happened,", |
| 10 | + AttributeError: "You tried to access an attribute that doesn't exist on this object,", |
| 11 | + BufferError: "A buffer-related operation failed,", |
| 12 | + EOFError: "Unexpected end of input — likely reading past the end of a file or input stream,", |
| 13 | + ImportError: "Python couldn't import the requested module or object,", |
| 14 | + LookupError: "A generic lookup operation failed (e,g,, index or key lookup),", |
| 15 | + MemoryError: "The system ran out of memory while trying to complete the operation,", |
| 16 | + NameError: "You tried to use a variable or function that hasn’t been defined,", |
| 17 | + OSError: "A system-related operation failed — like accessing a file or device,", |
| 18 | + ReferenceError: "A failed reference was used after the object was deleted,", |
| 19 | + RuntimeError: "Something unexpected happened during runtime,", |
| 20 | + StopAsyncIteration: "Async iteration finished — nothing more to yield,", |
| 21 | + StopIteration: "Iteration has finished — the loop is done,", |
| 22 | + SyntaxError: "There's a syntax error in your Python code,", |
| 23 | + SystemError: "A low-level internal error occurred,", |
| 24 | + TypeError: "An operation received a value of the wrong type,", |
| 25 | + ValueError: "The value was the right type but made no sense,", |
| 26 | + Warning: "A generic warning was raised,", |
| 27 | + FloatingPointError: "A floating point calculation failed,", |
| 28 | + OverflowError: "A number became too large to handle,", |
| 29 | + ZeroDivisionError: "You tried to divide by zero — that's not allowed,", |
| 30 | + BytesWarning: "Warning related to bytes or bytecode operations,", |
| 31 | + DeprecationWarning: "You're using a deprecated feature that will be removed soon,", |
| 32 | + EncodingWarning: "Warning related to encoding operations,", |
| 33 | + FutureWarning: "You're using a feature that will change in future versions,", |
| 34 | + ImportWarning: "There was something suspicious during an import,", |
| 35 | + PendingDeprecationWarning: "This feature is going away soon — but not just yet,", |
| 36 | + ResourceWarning: "A resource was not properly managed (e,g, file left open),", |
| 37 | + RuntimeWarning: "A runtime condition was suspicious but not fatal,", |
| 38 | + SyntaxWarning: "Something is wrong in the code's syntax but not fatal,", |
| 39 | + UnicodeWarning: "Detected problematic Unicode operation,", |
| 40 | + UserWarning: "A custom warning generated by the user,", |
| 41 | + BlockingIOError: "A non-blocking operation couldn’t proceed immediately,", |
| 42 | + ChildProcessError: "A child process operation failed,", |
| 43 | + ConnectionError: "A connection-related issue occurred,", |
| 44 | + FileExistsError: "The file already exists and can't be created again,", |
| 45 | + FileNotFoundError: "The specified file was not found,", |
| 46 | + InterruptedError: "A system call was interrupted by a signal,", |
| 47 | + IsADirectoryError: "Tried to treat a directory like a file,", |
| 48 | + NotADirectoryError: "Tried to access something as a directory but it's a file,", |
| 49 | + PermissionError: "You don't have permission to perform this action,", |
| 50 | + ProcessLookupError: "The specified process does not exist,", |
| 51 | + TimeoutError: "An operation took too long and timed out,", |
| 52 | + IndentationError: "Your code indentation is incorrect,", |
| 53 | + IndexError: "You're trying to access a list or array index that doesn’t exist,", |
| 54 | + KeyError: "You're using a key that isn’t present in the dictionary,", |
| 55 | + ModuleNotFoundError: "Tried to import a module that doesn’t exist,", |
| 56 | + NotImplementedError: "A feature was called that hasn’t been implemented yet,", |
| 57 | + RecursionError: "Your code called itself too many times — infinite recursion?", |
| 58 | + UnboundLocalError: "You tried to use a local variable before giving it a value,", |
| 59 | + UnicodeError: "A Unicode-related error occurred,", |
| 60 | + BrokenPipeError: "Tried writing to a pipe that's no longer open,", |
| 61 | + ConnectionAbortedError: "The connection was closed by the remote host,", |
| 62 | + ConnectionRefusedError: "The remote host actively refused the connection,", |
| 63 | + ConnectionResetError: "The connection was forcibly closed by the remote host,", |
| 64 | + TabError: "You mixed tabs and spaces — Python doesn't allow that,", |
| 65 | + UnicodeDecodeError: "Failed to decode a byte sequence,", |
| 66 | + UnicodeEncodeError: "Failed to encode text into bytes,", |
| 67 | + UnicodeTranslateError: "Failed to translate characters during encoding,", |
| 68 | + ExceptionGroup: "Multiple exceptions occurred simultaneously," |
| 69 | +} |
0 commit comments