$ npm install not-enough-errors
Name | Description |
---|---|
ArgumentError | Thrown when a non-null argument that is passed to a method is invalid |
ArgumentNullError | Thrown when null argument is passed to a method |
ArgumentOutOfRangeError | Thrown when the value of an argument is outside the range of valid values |
FileNotFoundError | Thrown when a physical file does not exist at the specified location |
KeyNotFoundError | Thrown when the key specified for accessing an element in a collection does not match any key in the collection |
NotImplementedError | Thrown when a requested function is not implemented |
The base class for all errors of this library.
abstract class BaseError extends Error
Thrown when a non-null argument that is passed to a method is invalid
See an example here
class ArgumentError extends BaseError
public constructor(paramName: string, message?: string)
Name | Type | Description |
---|---|---|
paramName |
string |
The name of the parameter that causes this error |
message |
string | undefined |
The error message |
Thrown when null argument is passed to a method
See an example here
class ArgumentNullError extends ArgumentError
public constructor(paramName: string, message?: string)
Name | Type | Description |
---|---|---|
paramName |
string |
The name of the parameter that causes this error |
message |
string | undefined |
The error message |
Thrown when the value of an argument is outside the range of valid values
See an example here
class ArgumentOutOfRangeError extends ArgumentError
public constructor(paramName: string, message?: string)
Name | Type | Description |
---|---|---|
paramName |
string |
The name of the parameter that causes this error |
message |
string | undefined |
The error message |
Thrown when a physical file does not exist at the specified location
See an example here
class FileNotFoundError extends BaseError
public constructor(fileName: string, message?: string)
Name | Type | Description |
---|---|---|
fileName |
string |
The file name that cannot be found |
message |
string | undefined |
The error message |
Thrown when the key specified for accessing an element in a collection does not match any key in the collection
See an example here
class KeyNotFoundError extends BaseError
public constructor(key: string, message?: string)
Name | Type | Description |
---|---|---|
key |
string |
The key that causes this error |
message |
string | undefined |
The error message |
Thrown when a requested function is not implemented
See an example here
class NotImplementedError extends BaseError
public constructor(fileName: string, message?: string)
Name | Type | Description |
---|---|---|
funcName |
string | undefined |
The name of the function |
message |
string | undefined |
The error message |
This project is MIT licensed.