Fixed error handling of compute engine crashes
This commit is contained in:
@@ -12,11 +12,19 @@ export default function computeCreature(creatureId){
|
|||||||
writeAlteredProperties(computation);
|
writeAlteredProperties(computation);
|
||||||
writeScope(creatureId, computation.scope);
|
writeScope(creatureId, computation.scope);
|
||||||
} catch (e){
|
} catch (e){
|
||||||
|
const errorText = e.reason || e.message || e.toString();
|
||||||
computation.errors.push({
|
computation.errors.push({
|
||||||
type: 'crash',
|
type: 'crash',
|
||||||
details: e.reason || e.message || e.toString(),
|
details: {error: errorText},
|
||||||
});
|
});
|
||||||
console.error(e);
|
const logError = {
|
||||||
|
creatureId,
|
||||||
|
computeError: errorText,
|
||||||
|
};
|
||||||
|
if (e.stack){
|
||||||
|
logError.location = e.stack.split('\n')[1];
|
||||||
|
}
|
||||||
|
console.error(logError);
|
||||||
} finally {
|
} finally {
|
||||||
writeErrors(creatureId, computation.errors);
|
writeErrors(creatureId, computation.errors);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user