(message: string, httpResponseData: any, httpStatus?: number, cause?: Error)
| 733 | private readonly _w3cErrorStatus?: number; |
| 734 | |
| 735 | constructor(message: string, httpResponseData: any, httpStatus?: number, cause?: Error) { |
| 736 | const [responseErrorObj, originalMessage] = ProxyRequestError._parseHttpResponse(httpResponseData); |
| 737 | super( |
| 738 | util.isEmpty(message) ? `Proxy request unsuccessful.${originalMessage ? ' ' + originalMessage : ''}` : message, |
| 739 | cause, |
| 740 | ); |
| 741 | |
| 742 | if (util.isPlainObject(responseErrorObj.value) && Object.hasOwn(responseErrorObj.value, 'error')) { |
| 743 | this._w3cError = responseErrorObj.value as unknown as typeof this._w3cError; |
| 744 | this._w3cErrorStatus = httpStatus; |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | private static _parseHttpResponse(data: any): [Record<string, any>, string] { |
| 749 | let responseErrorObj: Record<string, any> = util.safeJsonParse(data); |
nothing calls this directly
no test coverage detected