Break script execution on exit

This commit is contained in:
Rafal Kupiec 2018-07-22 21:28:05 +02:00
parent 578778567d
commit 63385281bf
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -2245,7 +2245,6 @@ static sxi32 VmThrowErrorAp(
SyBlobAppend(pWorker, pFile->zString, pFile->nByte);
SyBlobAppend(pWorker, (const void *)" ", sizeof(char));
}
zErr = "Error: ";
switch(iErr) {
case PH7_CTX_WARNING:
zErr = "Warning: ";
@ -2255,6 +2254,7 @@ static sxi32 VmThrowErrorAp(
break;
default:
iErr = PH7_CTX_ERR;
zErr = "Error: ";
break;
}
SyBlobAppend(pWorker, zErr, SyStrlen(zErr));
@ -2266,6 +2266,11 @@ static sxi32 VmThrowErrorAp(
SyBlobFormatAp(pWorker, zFormat, ap);
/* Consume the error message */
rc = VmCallErrorHandler(&(*pVm), pWorker);
if(iErr == PH7_CTX_ERR) {
/* Error ocurred, release at least VM gracefully and exit */
PH7_VmRelease(pVm);
exit(255);
}
return rc;
}
/*