MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxAbort

Function fxAbort

xs/platforms/pebble/xsPlatform.c:104–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void 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

Callers

nothing calls this directly

Calls 3

fxAbortStringFunction · 0.85
fxToStringFunction · 0.85
fxExitToHostFunction · 0.85

Tested by

no test coverage detected