Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TypeMismatchError

This error represents the condition when a getter function of the Environment, like EnvironmentManager.getNumber, is called and the type of the default didn't match the method return value.

Example

Environment.register("TEST", "string");
Environment.getNumber("TEST"); // Throws TypeMismatchError

Hierarchy

  • Error
    • TypeMismatchError

Index

Constructors

constructor

  • new TypeMismatchError(key: string, expectedType: string, actualType: string): TypeMismatchError
  • Construct the error.

    Parameters

    • key: string

      The key in error.

    • expectedType: string

      The expected type. Usually determined the type of call expected (getNumber, getString, etc).

    • actualType: string

      The actual type. Usually determined by the typeof the registered default.

    Returns TypeMismatchError

Properties

actualType

actualType: string

The actual type. Usually determined by the typeof the registered default.

expectedType

expectedType: string

The expected type. Usually determined the type of call expected (getNumber, getString, etc).

key

key: string

The key in error.

message

message: string

name

name: string

Optional stack

stack: string

Static Error

Error: ErrorConstructor

Generated using TypeDoc