UNPKG

1.3 kBTypeScriptView Raw
1/**
2 * The `GitError` is thrown when the underlying `git` process throws a
3 * fatal exception (eg an `ENOENT` exception when attempting to use a
4 * non-writable directory as the root for your repo), and acts as the
5 * base class for more specific errors thrown by the parsing of the
6 * git response or errors in the configuration of the task about to
7 * be run.
8 *
9 * When an exception is thrown, pending tasks in the same instance will
10 * not be executed. The recommended way to run a series of tasks that
11 * can independently fail without needing to prevent future tasks from
12 * running is to catch them individually:
13 *
14 * ```typescript
15 import { gitP, SimpleGit, GitError, PullResult } from 'simple-git';
16
17 function catchTask (e: GitError) {
18 return e.
19 }
20
21 const git = gitP(repoWorkingDir);
22 const pulled: PullResult | GitError = await git.pull().catch(catchTask);
23 const pushed: string | GitError = await git.pushTags().catch(catchTask);
24 ```
25 */
26export declare class GitError extends Error {
27 task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined;
28 constructor(task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined, message?: string);
29}