MCPcopy Create free account
hub / github.com/appium/appium / constructor

Method constructor

packages/base-driver/lib/protocol/errors.ts:735–746  ·  view source on GitHub ↗
(message: string, httpResponseData: any, httpStatus?: number, cause?: Error)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 2

_parseHttpResponseMethod · 0.80
isEmptyMethod · 0.80

Tested by

no test coverage detected