1.5.1 โ€ข Published 7 months ago

@odg/exception v1.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

codecov Stargazers Made by ODGodinho Forks Repository size GitHub last commit License StyleCI FOSSA Status

Table of Contents


๐ŸŽ‡ Benefits

  • ๐Ÿš€ Instance Error with previews error
  • ๐ŸŽ‡ Code quality guaranteed

๐Ÿ“— Libraries

๐Ÿ“ Dependencies

โฉ Get Started


๐Ÿ”˜ Installation

Run commands:

yarn add @odg/exception

๐Ÿ’ป Prepare To Develop

Create custom exception

import { Exception } from "@odg/exception";

class MyException extends Exception {

}

Instance Exception

try {
    // code
} catch (error) {
    throw new MyException("message", error, "EXCEPTION_CODE");
}

Props

interface Exception {
    message: string; // Message of exception
    code?: string | number; // Code of exception
    stack: string; // Stack of Exception
    preview?: UnknownException; // Preview exception parsed to UnknownException class
    original?: unknown // Original Preview Exception (Error, Exception, string, unknown)
}

๐Ÿ“ Start Project

First install dependencies with the following command

yarn install
# or
npm install

๐Ÿ“จ Build and Run

To build the project, you can use the following command

if you change files, you need to run yarn build and yarn test again

yarn build && yarn test

๐Ÿงช Teste Code

To Test execute this command

yarn test
# or
yarn test:watch

License

FOSSA Status