@etherspot/data-utils
Version:
Etherspot Data Utils
1 lines • 867 B
Source Map (JSON)
{"version":3,"sources":["../../src/sdk/common/exceptions/validation.exception.ts"],"sourcesContent":["import { Exception } from './exception';\nimport { ValidationError } from './interfaces';\n\nexport class ValidationException extends Exception {\n static throw(property: string, constraints: { [key: string]: string }) {\n const validationError: ValidationError = {\n property,\n constraints,\n };\n\n throw new ValidationException([validationError]);\n }\n\n constructor(public errors: ValidationError[]) {\n super(JSON.stringify(errors, null, 2));\n }\n}\n"],"mappings":";;;;;AAGO,IAAM,sBAAN,MAAM,6BAA4B,UAAU;AAAA,EAUjD,YAAmB,QAA2B;AAC5C,UAAM,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AADpB;AAAA,EAEnB;AAAA,EAXA,OAAO,MAAM,UAAkB,aAAwC;AACrE,UAAM,kBAAmC;AAAA,MACvC;AAAA,MACA;AAAA,IACF;AAEA,UAAM,IAAI,qBAAoB,CAAC,eAAe,CAAC;AAAA,EACjD;AAKF;","names":[]}