Branch data Line data Source code
1 : : /* 2 : : * Copyright (c) 2016 Andrew Kelley 3 : : * 4 : : * This file is part of zig, which is MIT licensed. 5 : : * See http://opensource.org/licenses/MIT 6 : : */ 7 : : 8 : : #include "error.hpp" 9 : : 10 : 0 : const char *err_str(Error err) { 11 [ # # # # : 0 : switch (err) { # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ] 12 : 0 : case ErrorNone: return "(no error)"; 13 : 0 : case ErrorNoMem: return "out of memory"; 14 : 0 : case ErrorInvalidFormat: return "invalid format"; 15 : 0 : case ErrorSemanticAnalyzeFail: return "semantic analyze failed"; 16 : 0 : case ErrorAccess: return "access denied"; 17 : 0 : case ErrorInterrupted: return "interrupted"; 18 : 0 : case ErrorSystemResources: return "lack of system resources"; 19 : 0 : case ErrorFileNotFound: return "file not found"; 20 : 0 : case ErrorFileSystem: return "file system error"; 21 : 0 : case ErrorFileTooBig: return "file too big"; 22 : 0 : case ErrorDivByZero: return "division by zero"; 23 : 0 : case ErrorOverflow: return "overflow"; 24 : 0 : case ErrorPathAlreadyExists: return "path already exists"; 25 : 0 : case ErrorUnexpected: return "unexpected error"; 26 : 0 : case ErrorExactDivRemainder: return "exact division had a remainder"; 27 : 0 : case ErrorNegativeDenominator: return "negative denominator"; 28 : 0 : case ErrorShiftedOutOneBits: return "exact shift shifted out one bits"; 29 : 0 : case ErrorCCompileErrors: return "C compile errors"; 30 : 0 : case ErrorEndOfFile: return "end of file"; 31 : 0 : case ErrorIsDir: return "is directory"; 32 : 0 : case ErrorNotDir: return "not a directory"; 33 : 0 : case ErrorUnsupportedOperatingSystem: return "unsupported operating system"; 34 : 0 : case ErrorSharingViolation: return "sharing violation"; 35 : 0 : case ErrorPipeBusy: return "pipe busy"; 36 : 0 : case ErrorPrimitiveTypeNotFound: return "primitive type not found"; 37 : 0 : case ErrorCacheUnavailable: return "cache unavailable"; 38 : 0 : case ErrorPathTooLong: return "path too long"; 39 : 0 : case ErrorCCompilerCannotFindFile: return "C compiler cannot find file"; 40 : 0 : case ErrorReadingDepFile: return "failed to read .d file"; 41 : 0 : case ErrorInvalidDepFile: return "invalid .d file"; 42 : 0 : case ErrorMissingArchitecture: return "missing architecture"; 43 : 0 : case ErrorMissingOperatingSystem: return "missing operating system"; 44 : 0 : case ErrorUnknownArchitecture: return "unrecognized architecture"; 45 : 0 : case ErrorUnknownOperatingSystem: return "unrecognized operating system"; 46 : 0 : case ErrorUnknownABI: return "unrecognized C ABI"; 47 : 0 : case ErrorInvalidFilename: return "invalid filename"; 48 : 0 : case ErrorDiskQuota: return "disk space quota exceeded"; 49 : 0 : case ErrorDiskSpace: return "out of disk space"; 50 : 0 : case ErrorUnexpectedWriteFailure: return "unexpected write failure"; 51 : 0 : case ErrorUnexpectedSeekFailure: return "unexpected seek failure"; 52 : 0 : case ErrorUnexpectedFileTruncationFailure: return "unexpected file truncation failure"; 53 : 0 : case ErrorUnimplemented: return "unimplemented"; 54 : 0 : case ErrorOperationAborted: return "operation aborted"; 55 : 0 : case ErrorBrokenPipe: return "broken pipe"; 56 : 0 : case ErrorNoSpaceLeft: return "no space left"; 57 : 0 : case ErrorNoCCompilerInstalled: return "no C compiler installed"; 58 : 0 : case ErrorNotLazy: return "not lazy"; 59 : 0 : case ErrorIsAsync: return "is async"; 60 : : } 61 : 0 : return "(invalid error)"; 62 : : }