4

GitHub - ksawery29/awesome-errors: an error handling library

 11 months ago
source link: https://github.com/ksawery29/awesome-errors
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Warning
Awesome-errors is still being worked on. If you want to help, feel free to send a pull request or an issue.

awesome-errors

about

Awesome-errors is an error handling library built with readability in mind. It's written in typescript and works with Node.js only.

why to use it?

When it comes to error handling most of the time errors are hard to read and debug. With awesome-errors it shows only the most important content of a stack and a preview of where the stack was thrown, making it a lot easier to debug.

example

try {
    throw new Error("something went wrong");
} catch (error) {
    new AError(error);
}

output

installation

Just install it using npm: npm install awesome-errors and import it: import AError from "awesome-errors"


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK