forked from MapComplete/MapComplete
Better error handling
This commit is contained in:
parent
700cad1000
commit
979041dacb
6 changed files with 44 additions and 21 deletions
|
@ -216,13 +216,18 @@ export class Fuse<T> extends DesugaringStep<T> {
|
|||
const information = []
|
||||
for (let i = 0; i < this.steps.length; i++) {
|
||||
const step = this.steps[i];
|
||||
let r = step.convert(json, "While running step " + step.name + ": " + context)
|
||||
errors.push(...r.errors ?? [])
|
||||
warnings.push(...r.warnings ?? [])
|
||||
information.push(...r.information ?? [])
|
||||
json = r.result
|
||||
if (errors.length > 0) {
|
||||
break;
|
||||
try{
|
||||
let r = step.convert(json, "While running step " + step.name + ": " + context)
|
||||
errors.push(...r.errors ?? [])
|
||||
warnings.push(...r.warnings ?? [])
|
||||
information.push(...r.information ?? [])
|
||||
json = r.result
|
||||
if (errors.length > 0) {
|
||||
break;
|
||||
}
|
||||
}catch(e){
|
||||
console.error("Step "+step.name+" failed due to "+e);
|
||||
throw e
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue