| 102 | } |
| 103 | |
| 104 | void fxAbort(txMachine* the, int status) |
| 105 | { |
| 106 | char *msg = (char *)fxAbortString(status); |
| 107 | char *reason = ""; |
| 108 | #ifdef mxDebug |
| 109 | if (XS_DEBUGGER_EXIT == status) |
| 110 | return; |
| 111 | #endif |
| 112 | if (XS_UNHANDLED_EXCEPTION_EXIT == status) { |
| 113 | xsSlot errorStack = xsGet(xsException, mxID(_stack)); |
| 114 | xsStringValue stackStr = xsToString(errorStack); |
| 115 | APP_LOG(APP_LOG_LEVEL_ERROR, "%s", stackStr); |
| 116 | |
| 117 | reason = fxToString(the, &mxException); |
| 118 | char *r = c_malloc(c_strlen(reason) + 1); |
| 119 | if (r) { |
| 120 | c_strcpy(r, reason); |
| 121 | setModdableAppState(abortReason, r); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | APP_LOG(APP_LOG_LEVEL_ERROR, "fxAbort %s: %s", msg, reason); |
| 126 | |
| 127 | the->exitStatus = status; |
| 128 | fxExitToHost(the); |
| 129 | } |
| 130 | |
| 131 | #ifdef mxDebug |
| 132 |
nothing calls this directly
no test coverage detected