Mon 16 Mar 11:09:06 CET 2026
This commit is contained in:
parent
0e8838b640
commit
0904e0af50
57
src/error.h
Normal file
57
src/error.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef _ERROR_H
|
||||
#define _ERROR_H
|
||||
|
||||
|
||||
typedef enum {
|
||||
EOK=0,
|
||||
ECALL, // CALL/CCALL error
|
||||
EDATA, // DATA error
|
||||
EEXPR, // Expression error
|
||||
EEVENT, // Event error
|
||||
EHEAP, // Heap error
|
||||
EINPUT, // Input error (EWOULDBLOCk...)
|
||||
ENOTFOUND,
|
||||
EOP, // Instruction error
|
||||
EPROC, // Procedure error
|
||||
ERANGE, // Array range error
|
||||
ERUN, // Run-time error
|
||||
ESTACK, // Stack error
|
||||
ESYNTAX, // Syntax error
|
||||
ETASK, // Task (creation) error
|
||||
ETODO, // Not yet implemented
|
||||
ETYPE,
|
||||
EVAR, // Variable error
|
||||
EWOULDBLOCK, // Blocking IO not allowed
|
||||
} errors_t;
|
||||
|
||||
#define ERRORS char *Errors[]={\
|
||||
"EOK",\
|
||||
"ECALL",\
|
||||
"EDATA",\
|
||||
"EEXPR",\
|
||||
"EEVENT",\
|
||||
"EHEAP",\
|
||||
"EINPUT",\
|
||||
"ENOTFOUND",\
|
||||
"EOP",\
|
||||
"EPROC",\
|
||||
"ERANGE",\
|
||||
"ERUN",\
|
||||
"ESTACK",\
|
||||
"ESYNTAX",\
|
||||
"ETASK",\
|
||||
"ETODO",\
|
||||
"ETYPE",\
|
||||
"EVAR",\
|
||||
"EWOULDBLOCK",\
|
||||
}
|
||||
extern char *Errors[];
|
||||
|
||||
typedef int8_t error_t;
|
||||
// void error(reg_t *R,error_t e);
|
||||
|
||||
#define RETURNERROR(R,e,status) { error(R,e); return status; }
|
||||
#define RETURNERROR0(R,e) { error(R,e); return; }
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user