![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
spur-errors
Advanced tools
Common error builder utility for Node.js. Contains common error types, and stack trace tracking to support more detailed error messages.
Common error builder utility for Node.js. Contains common error types, and stack trace tracking to support more detailed error messages.
The Spur Framework is a collection of commonly used Node.JS libraries used to create common application types with shared libraries.
Visit NPMJS.org for a full list of Spur Framework libraries >>
Supports active Node versions in the LTS Schedule. (view current versions)
$ npm install --save spur-errors
let SpurErrors = require("spur-errors");
SpurErrors.NotFoundError.create("could not find it");
The API is designed to be daisy chained with all of the following base commands that are a part of all of the error types.
Creates an instance of a SpurError for the type used.
try {
...
}
catch(err) {
SpurErrors.NotFound.create("Some error", err);
}
Sets an error code to later be used by error handlers.
SpurErrors.NotFound.create("Not found").setErrorCode("leaf_error");
Overrides the error message passed in.
SpurErrors.NotFound.create("Not found").setMessage("Unable to find the restaurant.");
Setting the response status code to be sent back down to the client.
SpurErrors.NotFound.create("Not found").setStatusCode(404);
Sets customizable data that can be used down the error stack chain.
SpurErrors.NotFound.create("Not found").setData({headers: req.headers});
Property | Description |
---|---|
internalError | The original error object passed in |
message | Either passed in during the create call or during the parsing of the internal error |
stack | Parsed from the originally passed in internal error |
errorCode | Custom error code |
statusCode | Custom status code to be used by the Express.JS response |
data | Custom data object to be used anyone in the flow |
Error Type | Status Code | Message | Error Code |
---|---|---|---|
ValidationError | 400 | Validation Error | validation_error |
UnauthorizedError | 401 | Unauthorized Error | unauthorized_error |
ForbiddenError | 403 | Forbidden Error | forbidden_error |
NotFoundError | 404 | Not Found Error | not_found_error |
MethodNotAllowedError | 405 | Method not allowed | method_not_allowed_error |
RequestTimeoutError | 408 | Request Timeout Error | request_timeout_error |
AlreadyExistsError | 409 | Already Exists Error | already_exists_error |
InternalServerError | 500 | Internal Server Error | internal_server_error |
BadGatewayError | 502 | Bad Gateway Error | bad_gateway_error |
ServiceUnavailableError | 503 | Service Unavailable Error | service_unavailable_error |
GatewayTimeoutError | 504 | Gateway Unavailable Error | gateway_timeout_error |
SpurErrors.ValidationError.create("Invalid input");
// => {statusCode: 400, message: "Validation Error", errorCode: "validation_error", ....}
This library is maintained by
Please send in pull requests and they will be reviewed in a timely manner. Please review this generic guide to submitting a good pull requests. The only things we ask in addition are the following:
The majority of the settings are controlled using an EditorConfig configuration file. To use it please download a plugin for your editor of choice.
To run the test suite, first install the dependancies, then run npm test
$ npm install
$ npm test
FAQs
Common error builder utility for Node.js. Contains common error types, and stack trace tracking to support more detailed error messages.
The npm package spur-errors receives a total of 123 weekly downloads. As such, spur-errors popularity was classified as not popular.
We found that spur-errors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.