2016-12-05 10:06:13 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of zig, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
2015-11-05 15:05:25 +08:00
|
|
|
#include "error.hpp"
|
|
|
|
|
|
|
|
const char *err_str(int err) {
|
|
|
|
switch ((enum Error)err) {
|
2015-11-30 17:11:31 +08:00
|
|
|
case ErrorNone: return "(no error)";
|
2015-11-05 15:05:25 +08:00
|
|
|
case ErrorNoMem: return "out of memory";
|
|
|
|
case ErrorInvalidFormat: return "invalid format";
|
2015-12-01 10:58:53 +08:00
|
|
|
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";
|
2016-04-13 07:18:41 +08:00
|
|
|
case ErrorDivByZero: return "division by zero";
|
|
|
|
case ErrorOverflow: return "overflow";
|
2017-04-28 14:22:12 +08:00
|
|
|
case ErrorPathAlreadyExists: return "path already exists";
|
|
|
|
case ErrorUnexpected: return "unexpected error";
|
2017-05-07 11:13:12 +08:00
|
|
|
case ErrorExactDivRemainder: return "exact division had a remainder";
|
|
|
|
case ErrorNegativeDenominator: return "negative denominator";
|
2017-08-09 22:09:38 +08:00
|
|
|
case ErrorShiftedOutOneBits: return "exact shift shifted out one bits";
|
2017-11-30 12:09:35 +08:00
|
|
|
case ErrorCCompileErrors: return "C compile errors";
|
2015-11-05 15:05:25 +08:00
|
|
|
}
|
|
|
|
return "(invalid error)";
|
|
|
|
}
|