UNPKG

2.08 kBSource Map (JSON)View Raw
1{"version":3,"file":"error.js","sourceRoot":"","sources":["error.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA6B;AAiB7B,IAAY,WASX;AATD,WAAY,WAAW;IACnB,+DAAgD,CAAA;IAChD,iEAAkD,CAAA;IAClD,qDAAsC,CAAA;IACtC,qGAAsF,CAAA;IACtF,6GAA8F,CAAA;IAC9F,+CAAgC,CAAA;IAChC,wEAAyD,CAAA;IACzD,4DAA6C,CAAA;AACjD,CAAC,EATW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAStB;AAED,MAAa,gBAAgB;IAGzB,YAAmB,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;QACtC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC/B,CAAC;CACJ;AAdD,4CAcC;AAED,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC","sourcesContent":["import * as util from \"util\";\n\nimport Command from \"./command\";\nimport Argument from \"./argument\";\nimport Option from \"./option\";\n\nexport interface ErrorParameters {\n message?: string;\n reason: ErrorReason;\n parts: string[];\n params?:\n { origin: Argument; arg: string; } |\n { origin: Argument; opts: any; args: string[]; } |\n { origin: Command<any, any>; args: string[]; } |\n { option: Option; opts: any; args: string[]; };\n}\n\nexport enum ErrorReason {\n UnsupportedFormatArgument = \"unsupported format\",\n ArgumentsRequired = \"1 or more arguments required\",\n ArgumentRequired = \"argument required\",\n ParameterCantPlacedAfterVariadic = \"parameter can not placed after variadic parameter\",\n ParameterCannPlacedAfterOptional = \"required parameter is not placed after optional parameter\",\n UnknownOption = \"unknown option\",\n OptionNameMismatch = \"short or long option name mismatch\",\n OptionValueRequired = \"option value required\",\n}\n\nexport class CommandpostError {\n stack?: string;\n\n constructor(public params: ErrorParameters) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n get name() {\n return this.constructor.name;\n }\n\n get message() {\n return this.params.message;\n }\n}\n\nutil.inherits(CommandpostError, Error);\n"]}
\No newline at end of file