3.1 KiB
Exit Code Mappings
For particular runtime environments ReCodEx can provide mappings of result codes to some custom messages. This is possible for example for Java, C# or Python where there can be custom wrappers/runners which might catch exceptions and then provide users more detailed information about evaluations.
Free Pascal
Actually, the FPC itself returns a specific code when a runtime error is encountered. All exit codes on the runtime errors list are translated into corresponding strings according to FPC documentation: https://www.freepascal.org/docs-html/user/userap4.html
Java
Runner: https://github.com/ReCodEx/utils/blob/master/runners/java/javarun.java
Exit Code | Exception | Mapping |
---|---|---|
0 | --- | OK |
1 | Throwable | Unknown error |
2 | InvocationTargetException | Other invocation target exception |
100 | OutOfMemoryError | Out of memory exception |
101 | SecurityException | Security exception |
102 | --- | Main class not found exception |
104 | IllegalAccessException | Illegal access exception |
105 | IllegalArgumentException | Illegal argument exception |
106 | StackOverflowError | Stack overflow exception |
107 | ArrayIndexOutOfBoundsException | Array index out of bounds exception |
108 | IndexOutOfBoundsException | Index out of bounds exception |
109 | NullPointerException | Null pointer exception |
110 | ArithmeticException | Arithmetic exception |
111 | OutOfMemoryError | Out of memory error |
112 | SecurityException | Security exception |
113 | IOException | IO exception |
C#
Runner: https://github.com/ReCodEx/utils/blob/master/runners/cs/Wrapper.cs
Exit Code | Exception | Mapping |
---|---|---|
0 | --- | OK |
1 | --- | User error |
101 | TargetInvocationException | Unhandled exception |
102 | NullReferenceException | Null reference error |
103 | OutOfMemoryException | Memory allocation error |
104 | IndexOutOfRangeException | Index out of range error |
105 | OverflowException | Overflow error |
106 | IOException | IO error |
107 | FileNotFoundException | File not found error |
108 | InvalidOperationException | Invalid operation error |
109 | DivideByZeroException | Division by zero error |
200 | Exception | Internal error |
201 | --- | No main method |
202 | --- | More main methods |
Python3
Runner: https://github.com/ReCodEx/utils/blob/master/runners/py/runner.py
Exit Code | Exception | Mapping |
---|---|---|
0 | --- | OK |
1 | BaseException | Unhandled exception |
101 | AssertionError | Assertion error |
102 | TypeError | Type error |
103 | NameError | Name not found error |
104 | EOFError | End of file error |
105 | AttributeError | Attribute access failed |
106 | IOError | IO error |
107 | OSError | OS error |
108 | LookupError | Lookup error |
109 | ValueError | Value error |
110 | ZeroDivisionError | Zero division error |
111 | ArithmeticError | Arithmetic error |
112 | ImportError | Import error |
113 | MemoryError | Memory allocation error |
114 | SyntaxError | Syntax error |