Refactor error types and error reporting

This commit is contained in:
Drew Galbraith 2023-06-07 08:50:08 -07:00
parent 81b925eea0
commit a5c4d40575
8 changed files with 137 additions and 147 deletions

View file

@ -12,17 +12,17 @@ void check(uint64_t code) {
switch (code) {
case Z_OK:
return;
case ZE_NOT_FOUND:
dbgln("crash: NOT_FOUND");
break;
case ZE_INVALID:
dbgln("crash: INVALID");
break;
case ZE_DENIED:
dbgln("crash: DENIED");
break;
case ZE_UNIMPLEMENTED:
case Z_ERR_UNIMPLEMENTED:
dbgln("crash: UNIMPLEMENTED");
case Z_ERR_CAP_NOT_FOUND:
dbgln("crash: missing capability");
break;
case Z_ERR_CAP_TYPE:
dbgln("crash: capability of the wrong type");
break;
case Z_ERR_CAP_DENIED:
dbgln("crash: capability permissions error");
break;
default:
dbgln("Unhandled code");
break;