INNER CODE UNIT · TypeScript

ApolloError

thebigredgeek/apollo-errors · src/index.ts:27

export class ApolloError extends ExtendableError {
  name: string;
  message: string;
  time_thrown: string;
  data: object;
  internalData: object;
  path: any;
  locations: any;
  _showLocations: boolean = false;
  _showPath: boolean = false;

  // NOTE: The object passed to the Constructor is actually `ctorData`.
  //       We are binding the constructor to the name and config object
  //       for the first two parameters inside of `createError`
  constructor(name: string, config: ErrorConfig, ctorConfig: ErrorConfig) {
    super((ctorConfig && ctorConfig.message) || (config && config.message) || '');

    const t = (ctorConfig && ctorConfig.time_thrown) || (config && config.time_thrown) || (new Date()).toISOString();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…