UNPKG

@eddye68/studio-client

Version:

The AWS service Studio client

1 lines 1.57 kB
{"version":3,"sources":["../../src/http-client/http-error.ts","../../src/http-client/http-response-error.ts"],"sourcesContent":["export class HttpError extends Error {\n\n\n\n /**\n *\n * @param {string} message\n */\n constructor(message: string) {\n super(message);\n this.name = \"HttpError\";\n }\n}","import { HttpError } from \"./http-error\";\n\nexport class HttpResponseError extends HttpError {\n\n readonly code: number;\n readonly name: string;\n\n /**\n *\n * @param {Response} response\n */\n constructor(message: string, response: Response) {\n super(HttpResponseError.buildMessage(message, response));\n this.code = response.status;\n this.name = \"HttpResponseError\";\n }\n\n static buildMessage(message : string, response: Response) : string {\n if(message) {\n return `HTTP Error: ${message}: ${response.status} ${response.statusText}`;\n } else {\n return `HTTP Error: ${response.status} ${response.statusText}`;\n }\n }\n}"],"mappings":";AAAO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjC,YAAY,SAAiB;AACzB,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EAChB;AACJ;;;ACVO,IAAM,oBAAN,MAAM,2BAA0B,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAS7C,YAAY,SAAiB,UAAoB;AAC7C,UAAM,mBAAkB,aAAa,SAAS,QAAQ,CAAC;AACvD,SAAK,OAAO,SAAS;AACrB,SAAK,OAAO;AAAA,EAChB;AAAA,EAEA,OAAO,aAAa,SAAkB,UAA6B;AAC/D,QAAG,SAAS;AACR,aAAO,eAAe,OAAO,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,IAC5E,OAAO;AACH,aAAO,eAAe,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,IAChE;AAAA,EACJ;AACJ;","names":[]}