forked from MapComplete/MapComplete
		
	Better error handling
This commit is contained in:
		
							parent
							
								
									e5dbeee621
								
							
						
					
					
						commit
						ad3a776366
					
				
					 6 changed files with 106 additions and 78 deletions
				
			
		|  | @ -202,13 +202,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