exception-html-template

1.0.0 • Public • Published

Exception Html Template

Used for generating a more user friendly as well as readable HTML template for exception.

This plugin is used as part of my exception handling for email logger module

How to use

$ npm install exception-html-template --save-dev
import {getExceptionTplPromise} from 'exception-html-template';
 
//javascript es6
app.use('*'(err, req, res, next)=> {
    getExceptionTplPromise(err, res.statusCode).then((htmlTpl)=> {
        res.send(htmlTpl);
    });
});
 
//typescript
app.use('*'(err: any, req: Request, res: Response, next: NextFunction)=> {
    getExceptionTplPromise(err, res.statusCode).then((htmlTpl: string)=> {
        res.send(htmlTpl);
    }()=> {
        console.log('err');
    });
});

ScreenShot

alt tag

LICENSE

MIT

Package Sidebar

Install

npm i exception-html-template

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • jf3096