| 103 | } |
| 104 | |
| 105 | void Err(const char* format, ...) // args like printf, throws an exception |
| 106 | { |
| 107 | if (err_g[0]) |
| 108 | { |
| 109 | // Recursive, we are already processing an error. |
| 110 | // Ok, only first error will be reported via LastErr. |
| 111 | // This happens if Err is called to report a stasm_search_auto fail. |
| 112 | } |
| 113 | else |
| 114 | { |
| 115 | char s[SBIG]; // temporary needed because format or ... may be err_g |
| 116 | va_list args; |
| 117 | va_start(args, format); |
| 118 | VSPRINTF(s, format, args); |
| 119 | va_end(args); |
| 120 | STRCPY(err_g, s); |
| 121 | } |
| 122 | PossiblyEnterDebugger(); |
| 123 | throw "Err"; // does not matter what we throw, will be caught by global catch |
| 124 | } |
| 125 | |
| 126 | const char* LastErr(void) // return the last error message, called by stasm_lasterr |
| 127 | { |
no test coverage detected