Rich error reporting
Ziggit
Rich error reporting
I want to develop a rich error reporting mechanism for zig. I understands that this involves some overhead. My personal c code uses this struct, which isn’t very rich, but its quite helpful. typedef struct { int code; // non-zero means an error happened const char *msg; const char *func; } Ret; #define RET ((Ret){0, SUCCESS_STR, __func__}) #define FN_RET(code, msg) ((Ret){code, msg, __func__}) #define FN_ERR() ((Ret){errno, strerror(errno), __func__}) This is generally fine, and i th...
0 comments
No comments yet.