You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@essential-projects/errors_ts

Package Overview
Dependencies
Maintainers
9
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@essential-projects/errors_ts

Technical errors that the protocol-adapters can handle

1.6.1
latest
Source
npmnpm
Version published
Maintainers
9
Created
Source

Errors_ts

A technical error provider.

Usage

  • If you build a transport layer, ...

    ... you can implement the handling of the Technical Errors provided by this package, so that when someone uses your layer, and an error ist thrown, you can handle it correctly.

  • If you want to use essential-projects-errors, ...

    ... you can just use the Errors provided by this package directly, or write your own non-technical errors that extend these errors.

    Every library that can handle these errors will be able to also correctly handle your extensions of these errors.

  • Either way...

    ... you just need to install it with:

    npm install --save @essential-projects/errors_ts
    

    And then import the errors like this:

    // JavaScript-variant
    const ERRORNAME = require('@essential-projects/errors_ts').ERRORNAME`
    
    // typescript-variant
    import {ERRORNAME1, ERRORNAME2, ERRORNAME3} from '@essential-projects/errors_ts';
    

    Where ERRORNAME is the name error you want to import.

    All essential-projects-errors have the isEssentialProjectsError-property, so they can be identified as such.

Test

In order to run the test:

npm test

Errors

The Errors are mostly based on http-status-codes. Every Error, except for the BaseError directly extends BaseError, and BaseError extends Error

NameCode
BaseError
Information Errors1xx
ContinueError100
SwitchingProtocolsError101
ProcessingError102
Redirect Errors3xx
MultipleChoicesError300
MovedError301
FoundError302
SeeOtherError303
NotModifiedError304
UseProxyError305
TemporaryRedirectError307
PermanentRedirectError308
Client Errors4xx
BadRequestError400
UnauthorizedError401
PaymentRequiredError402
ForbiddenError403
NotFoundError404
MethodNotAllowedError405
NotAcceptableError406
ProxyAuthenticationRequiredError407
RequestTimeoutError408
ConflictError409
GoneError410
LengthRequiredError411
PreconditionFailedError412
RequestTooLargeError413
URLTooLongError414
UnsupportedMediaTypeError415
RequestedRangeNotSatisfiableError416
ExpectationFailedError417
ImATeapotError418
PolicyNotFulfilledError420
MisdirectredRequestError421
UnprocessableEntityError422
LockedError423
FailedDependencyError424
UpgradeRequiredError426
PreconditionRequiredError428
TooManyRequestsError429
RequestHeaderTooLargeError431
UnavaliableForLegalReasonsError451
Server Errors5xx
InternalServerError500
NotImplementedError501
BadGatewayError502
ServiceUnavaliableError503
GatewayTimeoutError504
VersionNotSupportedError505
InsufficientStorageError507
LoopDetectedError508
BandwithLimitExceededError509
NetworkAuthenticationRequiredError511

FAQs

Package last updated on 25 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts