exception-html-template
v1.0.0
Published
Generate a readable html template for exception logging purpose
Downloads
8
Readme
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
LICENSE
MIT