npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

restify-standard-errors

v1.0.5

Published

A set of errors copied from Microsoft standard API error documentation.

Downloads

19

Readme

Restify Standard Errors

Funny Picture

Adds a standard set of API errors Restify framework based on Microsoft MSDN API Error Standards.

Installation

$ npm install restify-standard-errors

In your code put

var errors = require('restify-standard-errors')

Usage

server.get('/register', function(req, res, next) {
  return next(new errors.AccountAlreadyExistsError());
});

Complete List of Errors

| Error Name | HTTP status code | Description | |--------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| | ConditionNotMet | Not Modified (304) | The condition specified in the conditional header(s) was not met for a read operation. | | MissingRequiredHeader | Bad Request (400) | A required HTTP header was not specified. | | MissingRequiredXmlNode | Bad Request (400) | A required XML node was not specified in the request body. | | UnsupportedHeader | Bad Request (400) | One of the HTTP headers specified in the request is not supported. | | UnsupportedXmlNode | Bad Request (400) | One of the XML nodes specified in the request body is not supported. | | InvalidHeaderValue | Bad Request (400) | The value provided for one of the HTTP headers was not in the correct format. | | InvalidXmlNodeValue | Bad Request (400) | The value provided for one of the XML nodes in the request body was not in the correct format. | | MissingRequiredQueryParameter | Bad Request (400) | A required query parameter was not specified for this request. | | UnsupportedQueryParameter | Bad Request (400) | One of the query parameters specified in the request URI is not supported. | | InvalidQueryParameterValue | Bad Request (400) | An invalid value was specified for one of the query parameters in the request URI. | | OutOfRangeQueryParameterValue | Bad Request (400) | A query parameter specified in the request URI is outside the permissible range. | | RequestUrlFailedToParse | Bad Request (400) | The url in the request could not be parsed. | | InvalidUri | Bad Request (400) | The requested URI does not represent any resource on the server. | | InvalidHttpVerb | Bad Request (400) | The HTTP verb specified was not recognized by the server. | | EmptyMetadataKey | Bad Request (400) | The key for one of the metadata key-value pairs is empty. | | InvalidXmlDocument | Bad Request (400) | The specified XML is not syntactically valid. | | Md5Mismatch | Bad Request (400) | The MD5 value specified in the request did not match the MD5 value calculated by the server. | | InvalidMd5 | Bad Request (400) | The MD5 value specified in the request is invalid. The MD5 value must be 128 bits and Base64-encoded. | | OutOfRangeInput | Bad Request (400) | One of the request inputs is out of range. | | InvalidAuthenticationInfo | Bad Request (400) | The authentication information was not provided in the correct format. Verify the value of Authorization header. | | InvalidInput | Bad Request (400) | One of the request inputs is not valid. | | InvalidMetadata | Bad Request (400) | The specified metadata is invalid. It includes characters that are not permitted. | | InvalidResourceName | Bad Request (400) | The specifed resource name contains invalid characters. | | MetadataTooLarge | Bad Request (400) | The size of the specified metadata exceeds the maximum size permitted. | | ConditionHeadersNotSupported | BadRequest (400) | Condition headers are not supported. | | MultipleConditionHeadersNotSupported | Bad Request (400) | Multiple condition headers are not supported. | | AuthenticationFailed | Forbidden (403) | Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature. | | | ResourceNotFound | Not Found (404) | The specified resource does not exist. | | AccountIsDisabled | Forbidden (403) | The specified account is disabled. | | InsufficientAccountPermissions | Forbidden (403) | The account being accessed does not have sufficient permissions to execute this operation. | | UnsupportedHttpVerb | Method Not Allowed (405) | The resource doesn't support the specified HTTP verb. | | AccountAlreadyExists | Conflict (409) | The specified account already exists. | | AccountBeingCreated | Conflict (409) | The specified account is in the process of being created. | | ResourceAlreadyExists | Conflict (409) | The specified resource already exists. | | ResourceTypeMismatch | Conflict (409) | The specified resource type does not match the type of the existing resource. | | MissingContentLengthHeader | Length Required (411) | The Content-Length header was not specified. | | ConditionNotMet | Precondition Failed (412) | The condition specified in the conditional header(s) was not met for a write operation. | | RequestBodyTooLarge | Request Entity Too Large (413) | The size of the request body exceeds the maximum size permitted. | | InvalidRange | Requested Range Not Satisfiable (416) | The range specified is invalid for the current size of the resource. | | InternalError | Internal Server Error (500) | The server encountered an internal error. Please retry the request. | | OperationTimedOut | Internal Server Error (500) | The operation could not be completed within the permitted time. | | ServerBusy | Service Unavailable (503) | The server is currently unable to receive requests. Please retry your request. |

The Future?

I want to make it so that if you don't supply a 'message' then it automatically passes the description as a message

License

This work is Unlicensed! That means you can do with it whatever you want, although I hope you send me pull requests.