zig/src/error.cpp

18 lines
688 B
C++
Raw Normal View History

2015-11-05 15:05:25 +08:00
#include "error.hpp"
const char *err_str(int err) {
switch ((enum Error)err) {
case ErrorNone: return "(no error)";
2015-11-05 15:05:25 +08:00
case ErrorNoMem: return "out of memory";
case ErrorInvalidFormat: return "invalid format";
case ErrorSemanticAnalyzeFail: return "semantic analyze failed";
2015-12-01 17:29:21 +08:00
case ErrorAccess: return "access denied";
case ErrorInterrupted: return "interrupted";
case ErrorSystemResources: return "lack of system resources";
case ErrorFileNotFound: return "file not found";
case ErrorFileSystem: return "file system error";
case ErrorFileTooBig: return "file too big";
2015-11-05 15:05:25 +08:00
}
return "(invalid error)";
}