| 1 | export enum ValidationErrorEnum { |
| 2 | nameWithSpace = "The `name` option must not contain spaces", |
| 3 | missingToken = "We tried to search for a token in fig configs, but we found none. Use the `token` option to specify one", |
| 4 | noSpecPassed = "No spec passed. Neither `spec-path` or `binary-path` options were defined", |
| 5 | } |
| 6 | |
| 7 | export enum GenericErrorEnum { |
| 8 | noSpecDataReceived = "No spec was received. The `spec-path` option was not defined and the binary did not send any completion spec to stdout", |
| 9 | missingName = "Missing name. Either the `name` option or the `spec-path` option need to be passed to the program", |
| 10 | } |
| 11 | |
| 12 | const createErrorClass = (name: string) => |
| 13 | class extends Error { |
| 14 | constructor(message: string) { |
| 15 | super(message); |
| 16 | this.name = name; |
| 17 | } |
| 18 | }; |
| 19 | |
| 20 | export const GenerationError = createErrorClass("GenerationError"); |
| 21 | export const ValidationError = createErrorClass("ValidationError"); |
| 22 | export const BuildError = createErrorClass("BuildError"); |
| 23 | export const PublishError = createErrorClass("PublishError"); |