summaryrefslogtreecommitdiff
path: root/classes/SignalCLIError.ts
blob: d805dc147052c81f674aefe525cadac12e7b359e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
 * An error in signal-cli
 */
export class SignalCLIError extends Error {
    /**
     * Full path to the signal-cli executable
     */
    public executable: string;

    /**
     * List of all the command parameters used with signal-cli
     */
    public arguments: string[];

    /**
     * @param message - The error message
     * @param executable - The full path to the signal-cli executable
     * @param args - The list of all the command parameters used with signal-cli
     * @internal
     */
    constructor(message: string, executable?: string, args?: string[]) {
        super(message);
        this.name = "SignalCLIError";

        if (executable) this.executable = executable;
        if (args) this.arguments = args;
    }
}