An error in the app configuration which exposes all details of originating ConfigElement or ConfigObjectElement.

Example

Throw an error using values from originating config element:

throw new ConfigError({
...configElement,
reason: `The value must be 'Foo' or 'Bar' but it is 'WTF'`,
});

Hierarchy

  • Error
    • ConfigError

Constructors

  • Example

    Creation from ConfigElement directly:

    throw new ConfigError({ ...element, reason: 'It is foo bar.' });
    

    Parameters

    • options: {
          filePath: string;
          propertyPath: string;
          reason: string;
          value: unknown;
      }
      • Readonly filePath: string
      • Readonly propertyPath: string
      • Readonly reason: string
      • Readonly value: unknown

    Returns ConfigError

Properties

filePath: string
message: string
name: string
propertyPath: string
reason: string
stack?: string
value: unknown
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc