JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q19426F
  • License MIT

A collection of errors to mimic commonly used ones from the .NET world.

Package Exports

  • ts-dotnet-errors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ts-dotnet-errors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ts-dotnet-errors

A collection of commonly used errors from the .NET world. Enables for creating wrapped errors, and more. Typescript type declarations have been pre-included for ease of use.

Install

    npm install ts-dotnet-errors

How to use

throw new DepreciatedError();

throw new NotImplementedError('Method Foo() has not been implemented.');

try {
    loadDatabase();
}
catch(error) {
    throw new DatabaseError('Unknown error occured.', error);
}

Error types

  • ApplicationError
  • ArgumentError
  • ArgumentNullError
  • ArgumentOutOfRangeError
  • ArithmeticError
  • DatabaseError
  • DepreciatedError
  • DivideByZeroError
  • FileNotFoundError
  • IndexOutOfRangeError
  • InvalidOperationError
  • IOError
  • NotImplementedError
  • NotSupportedError
  • NullReferenceError
  • OverflowError