Browse Source

Handles when `captureStackTrace` is unavailable

main
Eric Amodio 3 years ago
parent
commit
a9282cceeb
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      src/git/locator.ts
  2. +2
    -2
      src/git/remotes/provider.ts
  3. +1
    -1
      src/git/shell.ts

+ 2
- 2
src/git/locator.ts View File

@ -6,7 +6,7 @@ export class UnableToFindGitError extends Error {
constructor(public readonly original?: Error) {
super('Unable to find git');
Error.captureStackTrace(this, UnableToFindGitError);
Error.captureStackTrace?.(this, UnableToFindGitError);
}
}
@ -14,7 +14,7 @@ export class InvalidGitConfigError extends Error {
constructor(public readonly original: Error) {
super('Invalid Git configuration');
Error.captureStackTrace(this, InvalidGitConfigError);
Error.captureStackTrace?.(this, InvalidGitConfigError);
}
}

+ 2
- 2
src/git/remotes/provider.ts View File

@ -250,7 +250,7 @@ export class AuthenticationError extends Error {
constructor(private original: Error) {
super(original.message);
Error.captureStackTrace(this, AuthenticationError);
Error.captureStackTrace?.(this, AuthenticationError);
}
}
@ -258,7 +258,7 @@ export class ClientError extends Error {
constructor(private original: Error) {
super(original.message);
Error.captureStackTrace(this, ClientError);
Error.captureStackTrace?.(this, ClientError);
}
}

+ 1
- 1
src/git/shell.ts View File

@ -151,7 +151,7 @@ export class RunError extends Error {
stdout = stdout.trim();
stderr = stderr.trim();
Error.captureStackTrace(this, RunError);
Error.captureStackTrace?.(this, RunError);
}
get cmd(): string | undefined {

Loading…
Cancel
Save