UNPKG

1.66 kBTypeScriptView Raw
1import { Exception } from '@poppinss/utils';
2import { CommandConstructorContract } from '../Contracts';
3/**
4 * Raised when a required argument is missing
5 */
6export declare class MissingArgumentException extends Exception {
7 command: CommandConstructorContract;
8 argumentName: string;
9 /**
10 * A required argument is missing
11 */
12 static invoke(name: string, command: CommandConstructorContract): MissingArgumentException;
13 /**
14 * Handle itself
15 */
16 handle(error: MissingArgumentException): void;
17}
18/**
19 * Raised when an the type of a flag is not as one of the excepted type
20 */
21export declare class InvalidFlagException extends Exception {
22 command?: CommandConstructorContract;
23 flagName: string;
24 expectedType: string;
25 /**
26 * Flag type validation failed.
27 */
28 static invoke(prop: string, expected: string, command?: CommandConstructorContract): InvalidFlagException;
29 /**
30 * Handle itself
31 */
32 handle(error: InvalidFlagException): void;
33}
34/**
35 * Raised when command is not registered with kernel
36 */
37export declare class InvalidCommandException extends Exception {
38 commandName: string;
39 suggestions: string[];
40 static invoke(commandName: string, suggestions: string[]): InvalidCommandException;
41 /**
42 * Handle itself
43 */
44 handle(error: InvalidCommandException): void;
45}
46/**
47 * Raised when an unknown flag is defined
48 */
49export declare class UnknownFlagException extends Exception {
50 /**
51 * Unknown flag
52 */
53 static invoke(prop: string): UnknownFlagException;
54 /**
55 * Handle itself
56 */
57 handle(error: UnknownFlagException): void;
58}