import { FlaggedError } from "./flaggedError" ; param title param statusCode param statusMessage param method param url param flags - Flags that characterize the error. See  FlaggedError . FLAGS .
  export class HTTPError extends Error { constructor ( public title ? , public statusCode ? , public statusMessage ? , public method ? , public url ? , public flags = 0 ) { super ( ) ; Object . setPrototypeOf ( this , HTTPError . prototype ) ; this . name = "HTTPError" ; this . message = this . _generateMessage ( title , statusCode , statusMessage , method , url ) ; this . stack = ( new Error ( this . message ) ) . stack ; } static FLAGS = FlaggedError . FLAGS ; isQuiet ( ) { return FlaggedError . prototype . isQuiet . call ( this ) ; } isTransient ( ) { return FlaggedError . prototype . isTransient . call ( this ) ; } private _generateMessage ( title , statusCode , statusMessage , method , url ) { const titleStr = ( title === undefined ) ? "" : String ( title ) ; const statusCodeStr = ( statusCode === undefined ) ? "" : String ( statusCode ) ; const statusMessageStr = ( statusMessage === undefined ) ? "" : String ( statusMessage ) ; const methodStr = ( method === undefined ) ? "" : String ( method ) ; const urlStr = ( url === undefined ) ? "" : String ( url ) ; return `HTTPError: ${ titleStr }, statusCode:${ statusCodeStr }, ` + `statusMessage:${ statusMessageStr }, method:${ methodStr }, url:${ urlStr }` ; } returns toString ( ) { const stack = ( this . stack === undefined ) ? "" : String ( this . stack ) ; const isFirefox = typeof window !== "undefined" && typeof window . navigator !== "undefined" && typeof window . navigator . userAgent !== "undefined" && window . navigator . userAgent . toLowerCase ( ) . indexOf ( "firefox" ) > - 1 ; return isFirefox ? `${ this . message }, stack:${ stack }` : `stack:${ stack }` ; } }