-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.c
More file actions
25 lines (24 loc) · 764 Bytes
/
error.c
File metadata and controls
25 lines (24 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "error.h"
// Error code to string translator
const char *error_to_string(int error) {
switch (error) {
case RUNTIME_OK_END:
return "Success";
case RUNTIME_ERROR_STACK_OVERFLOW:
return "Stack overflow";
case RUNTIME_ERROR_OUT_OF_RANGE_OP:
return "Used out-of-range pointer";
case RUNTIME_ERROR_UNKNOWN_OP:
return "Unknown operation";
case RUNTIME_ERROR_TIMEOUT:
return "Program timed out";
case FILE_ERROR_OPEN:
return "File opening error";
case FILE_ERROR_WIDTH_OVERFLOW:
return "Width overflow";
case FILE_ERROR_HEIGHT_OVERFLOW:
return "Height overflow";
default:
return "Unknown error code! This message should never be displayed!";
}
}