aboutsummaryrefslogtreecommitdiff
path: root/node_modules/simple-git/src/lib/errors/git-error.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/simple-git/src/lib/errors/git-error.d.ts')
-rw-r--r--node_modules/simple-git/src/lib/errors/git-error.d.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/simple-git/src/lib/errors/git-error.d.ts b/node_modules/simple-git/src/lib/errors/git-error.d.ts
new file mode 100644
index 0000000..a0677ab
--- /dev/null
+++ b/node_modules/simple-git/src/lib/errors/git-error.d.ts
@@ -0,0 +1,29 @@
+/**
+ * The `GitError` is thrown when the underlying `git` process throws a
+ * fatal exception (eg an `ENOENT` exception when attempting to use a
+ * non-writable directory as the root for your repo), and acts as the
+ * base class for more specific errors thrown by the parsing of the
+ * git response or errors in the configuration of the task about to
+ * be run.
+ *
+ * When an exception is thrown, pending tasks in the same instance will
+ * not be executed. The recommended way to run a series of tasks that
+ * can independently fail without needing to prevent future tasks from
+ * running is to catch them individually:
+ *
+ * ```typescript
+ import { gitP, SimpleGit, GitError, PullResult } from 'simple-git';
+
+ function catchTask (e: GitError) {
+ return e.
+ }
+
+ const git = gitP(repoWorkingDir);
+ const pulled: PullResult | GitError = await git.pull().catch(catchTask);
+ const pushed: string | GitError = await git.pushTags().catch(catchTask);
+ ```
+ */
+export declare class GitError extends Error {
+ task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined;
+ constructor(task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined, message?: string);
+}