@hypercolor/http-errors
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Hypercolor HTTP Errors

Table of Contents

Introduction

This tool is used by the team at Hypercolor to provide consistent HTTP Error formatting between services for a given project.

Installation

  • NPM
    • npm i @hypercolor/http-errors
  • Yarn
    • yarn add @hypercolor/http-errors

Usage

Example:

import { NotFoundError } from '@hypercolor/http-errors';

export class Service {
    public async findSomething(id: number) {
        const found = await this.findSomething(id);
        if (!found) {
            throw new NotFoundError('Something not found with ID: ' + id);
        }
        return found;
    }
}

More Information

Project Repository

Organization Repository

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    1

Package Sidebar

Install

npm i @hypercolor/http-errors

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

40.7 kB

Total Files

9

Last publish

Collaborators

  • seth_hypercolor
  • andrew-hypercolor