- handle JIT errors in a more user-friendly fashion than aborting.
* use I_Error instead of I_FatalError to abort. I_FatalError is only for things that are not recoverable and should not be handled outside of error cleanup and rethrowing. * only catch CRecoverableError in JitCompile. Everything else should fall through to the outermost catch block. * Do not I_FatalError out after handling the exception locally. Just print an error and return null, indicating failure.
This commit is contained in:
parent
45d7e5a038
commit
d7da2d838f
5 changed files with 32 additions and 32 deletions
|
|
@ -30,10 +30,10 @@ JitFuncPtr JitCompile(VMScriptFunction *sfunc)
|
|||
|
||||
return reinterpret_cast<JitFuncPtr>(AddJitFunction(&code, func));
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
catch (const CRecoverableError &e)
|
||||
{
|
||||
OutputJitLog(logger);
|
||||
I_FatalError("Unexpected JIT error: %s\n", e.what());
|
||||
Printf("%s: Unexpected JIT error: %s\n",sfunc->PrintableName.GetChars(), e.what());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue