I am trying to extend Error with ES6 and Babel. It isn\'t working out.
class MyError extends Error { constructor(m) { super(m); } } var error = new
This works for me:
/** * @class AuthorizationError * @extends {Error} */ export class AuthorizationError extends Error { message = 'UNAUTHORIZED'; name = 'AuthorizationError'; }