mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
catch any throwable
This commit is contained in:
@ -169,17 +169,24 @@ public class AsyncJobManager
|
||||
LOG.debug("Completed job " + uuidAndTypeStateKey.getUuid());
|
||||
return (result);
|
||||
}
|
||||
catch(Exception e)
|
||||
catch(Throwable t)
|
||||
{
|
||||
asyncJobStatus.setState(AsyncJobState.ERROR);
|
||||
asyncJobStatus.setCaughtException(e);
|
||||
if(t instanceof Exception e)
|
||||
{
|
||||
asyncJobStatus.setCaughtException(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
asyncJobStatus.setCaughtException(new QException("Caught throwable", t));
|
||||
}
|
||||
getStateProvider().put(uuidAndTypeStateKey, asyncJobStatus);
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// if user facing, just log an info, warn otherwise //
|
||||
//////////////////////////////////////////////////////
|
||||
LOG.log((e instanceof QUserFacingException) ? Level.INFO : Level.WARN, "Job ended with an exception", e, logPair("jobId", uuidAndTypeStateKey.getUuid()));
|
||||
throw (new CompletionException(e));
|
||||
LOG.log((t instanceof QUserFacingException) ? Level.INFO : Level.WARN, "Job ended with an exception", t, logPair("jobId", uuidAndTypeStateKey.getUuid()));
|
||||
throw (new CompletionException(t));
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
Reference in New Issue
Block a user