server-prop-types/UserError.js

16 lines
270 B
JavaScript

class UserError extends Error
{
constructor(code, props)
{
super(code);
this.props = props;
}
toString()
{
return this.message+(this.props ? ' '+JSON.stringify(this.props, null, 4) : '');
}
}
module.exports = UserError;