import { HttpError } from 'http-errors' ; /**
 * The error thrown by  GetAccessToken category export class AccessTokenError extends Error { public code : string ; constructor ( code , message ) { super ( message ) ; this . name = this . constructor . name ; Error . captureStackTrace ( this , this . constructor ) ; this . code = code ; Object . setPrototypeOf ( this , AccessTokenError . prototype ) ; } } export function htmlSafe ( input ) { return input . replace ( /&/g , '&amp;' ) . replace ( /</g , '&lt;' ) . replace ( />/g , '&gt;' ) . replace ( /"/g , '&quot;' ) . replace ( /'/g , '&#39;' ) ; } category export class HandlerError extends Error { public status : number | undefined ; public code : string | undefined ; constructor ( error ) { super ( htmlSafe ( error . message ) ) ; this . name = error . name ; if ( 'code' in error ) { this . code = error . code ; } if ( 'status' in error ) { this . status = error . status ; } Object . setPrototypeOf ( this , HandlerError . prototype ) ; } }