Simple error class for your REST server
$ npm install --save tiny-errors
code: number
This code will be used as HTTP Status (200, 404, 403, 500...)
message: string
This message will be use to send to client
constructor(code: number, message: string) {...}
// Example
let error = new TinyErrors(400, 'Username "tinyRush" is duplicated')
public static parse(error): TinyError {...}
// Example
// This method usually use to parse mongoose error to error with appropriate code (HTTP Status)
let error = TinyErrors.parse(mongooseValidationError);