
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@essential-projects/errors_ts
Advanced tools
Technical errors that the protocol-adapters can handle
A technical error provider.
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.
In order to run the test:
npm test
The Errors are mostly based on
http-status-codes.
Every Error, except for the BaseError
directly extends BaseError
, and
BaseError
extends Error
Name | Code |
---|---|
BaseError | |
Information Errors | 1xx |
ContinueError | 100 |
SwitchingProtocolsError | 101 |
ProcessingError | 102 |
Redirect Errors | 3xx |
MultipleChoicesError | 300 |
MovedError | 301 |
FoundError | 302 |
SeeOtherError | 303 |
NotModifiedError | 304 |
UseProxyError | 305 |
TemporaryRedirectError | 307 |
PermanentRedirectError | 308 |
Client Errors | 4xx |
BadRequestError | 400 |
UnauthorizedError | 401 |
PaymentRequiredError | 402 |
ForbiddenError | 403 |
NotFoundError | 404 |
MethodNotAllowedError | 405 |
NotAcceptableError | 406 |
ProxyAuthenticationRequiredError | 407 |
RequestTimeoutError | 408 |
ConflictError | 409 |
GoneError | 410 |
LengthRequiredError | 411 |
PreconditionFailedError | 412 |
RequestTooLargeError | 413 |
URLTooLongError | 414 |
UnsupportedMediaTypeError | 415 |
RequestedRangeNotSatisfiableError | 416 |
ExpectationFailedError | 417 |
ImATeapotError | 418 |
PolicyNotFulfilledError | 420 |
MisdirectredRequestError | 421 |
UnprocessableEntityError | 422 |
LockedError | 423 |
FailedDependencyError | 424 |
UpgradeRequiredError | 426 |
PreconditionRequiredError | 428 |
TooManyRequestsError | 429 |
RequestHeaderTooLargeError | 431 |
UnavaliableForLegalReasonsError | 451 |
Server Errors | 5xx |
InternalServerError | 500 |
NotImplementedError | 501 |
BadGatewayError | 502 |
ServiceUnavaliableError | 503 |
GatewayTimeoutError | 504 |
VersionNotSupportedError | 505 |
InsufficientStorageError | 507 |
LoopDetectedError | 508 |
BandwithLimitExceededError | 509 |
NetworkAuthenticationRequiredError | 511 |
FAQs
Technical errors that the protocol-adapters can handle
We found that @essential-projects/errors_ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.