How to use the bitgo.Errors.BitGoJsError function in bitgo

To help you get started, we’ve selected a few bitgo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BitGo / BitGoJS / modules / express / src / errors.ts View on Github external
// Descriptive error types for common issues which may arise
// during the operation of BitGoJS or BitGoExpress

// Each subclass needs the explicit Object.setPrototypeOf() so that instanceof will work correctly.
// See https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work

import { Errors } from 'bitgo';

export class TlsConfigurationError extends Errors.BitGoJsError {
  public constructor(message?) {
    super(message || 'TLS is configuration is invalid');
    Object.setPrototypeOf(this, TlsConfigurationError.prototype);
  }
}

export class NodeEnvironmentError extends Errors.BitGoJsError {
  public constructor(message?) {
    super(message || 'NODE_ENV is invalid for the current bitgo environment');
    Object.setPrototypeOf(this, NodeEnvironmentError.prototype);
  }
}

export class ApiResponseError extends Errors.BitGoJsError {
  public readonly status: number;
  public readonly result: any;
github BitGo / BitGoJS / modules / express / src / errors.ts View on Github external
// Descriptive error types for common issues which may arise
// during the operation of BitGoJS or BitGoExpress

// Each subclass needs the explicit Object.setPrototypeOf() so that instanceof will work correctly.
// See https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work

import { Errors } from 'bitgo';

export class TlsConfigurationError extends Errors.BitGoJsError {
  public constructor(message?) {
    super(message || 'TLS is configuration is invalid');
    Object.setPrototypeOf(this, TlsConfigurationError.prototype);
  }
}

export class NodeEnvironmentError extends Errors.BitGoJsError {
  public constructor(message?) {
    super(message || 'NODE_ENV is invalid for the current bitgo environment');
    Object.setPrototypeOf(this, NodeEnvironmentError.prototype);
  }
}

export class ApiResponseError extends Errors.BitGoJsError {
  public readonly status: number;
  public readonly result: any;
  public constructor(message: string | undefined, status: number, result?: any) {
    super(message);
    Object.setPrototypeOf(this, ApiResponseError.prototype);
    this.status = status;
    this.result = result;
  }
}
github BitGo / BitGoJS / modules / express / src / errors.ts View on Github external
export class TlsConfigurationError extends Errors.BitGoJsError {
  public constructor(message?) {
    super(message || 'TLS is configuration is invalid');
    Object.setPrototypeOf(this, TlsConfigurationError.prototype);
  }
}

export class NodeEnvironmentError extends Errors.BitGoJsError {
  public constructor(message?) {
    super(message || 'NODE_ENV is invalid for the current bitgo environment');
    Object.setPrototypeOf(this, NodeEnvironmentError.prototype);
  }
}

export class ApiResponseError extends Errors.BitGoJsError {
  public readonly status: number;
  public readonly result: any;
  public constructor(message: string | undefined, status: number, result?: any) {
    super(message);
    Object.setPrototypeOf(this, ApiResponseError.prototype);
    this.status = status;
    this.result = result;
  }
}