Better errors when an image is missing

This commit is contained in:
Pieter Vander Vennet 2022-07-06 11:14:19 +02:00
parent 494bc28ddf
commit f27b60f80d
3 changed files with 65 additions and 23 deletions

View file

@ -39,6 +39,14 @@ export abstract class Conversion<TIn, TOut> {
return DesugaringStep.strict(fixed)
}
public convertJoin(json: TIn, context: string, errors: string[], warnings?: string[], information?: string[]): TOut {
const fixed = this.convert(json, context)
errors?.push(...(fixed.errors ?? []))
warnings?.push(...(fixed.warnings ?? []))
information?.push(...(fixed.information ?? []))
return fixed.result
}
public andThenF<X>(f: (tout:TOut) => X ): Conversion<TIn, X>{
return new Pipe(
this,