Custom Stack
This deno module allows you to create the coolest looking errors, and customize the error stack trace as you wish. Given the opportunity cstack will also load your file content, highlight it, and pinpoint exactly where your errors are thrown.
Now you never have to be wondering âwhy the fuck doesnât this work?â ever again! With a 100% guarantee youâll receive less WTFs a minute using this tool. We got you covered!
Usage for lazy people
If youâre one of those people whoâs just interested in getting these fucking awesome looking errors in your application, all you have to do is import the Error replacement script.
import "https://deno.land/x/cstack/errors.ts";
Now before you go try this out and an error is spat at your face not looking as fancy as you expected, there is a known unfixable issue. CStack cannot replace errors thrown by V8 or the Deno core, but, weâve implemented a short fix for you. All you have to do it catch the error and rethrow it using one of cstackâs functions:
import { CustomStack } from "https://deno.land/x/cstack/cstack.ts";
try {
somethingThatWillCauseDenoOrV8ToThrow();
} catch (error) {
throw new CustomStack(error);
}
Now go have fun!
Usage for you advanced users
More information for advanced users coming whenever I feel like it, PR is welcome.