diff --git a/packages/validator/src/util/externalSignerClient.ts b/packages/validator/src/util/externalSignerClient.ts index 7cd01c81ff2..374da79b798 100644 --- a/packages/validator/src/util/externalSignerClient.ts +++ b/packages/validator/src/util/externalSignerClient.ts @@ -174,7 +174,7 @@ export async function externalSignerUpCheck(remoteUrl: string): Promise async function handleExternalSignerResponse(res: Response): Promise { if (!res.ok) { const errBody = await res.text(); - throw Error(errBody ? getErrorMessage(errBody) : res.statusText); + throw Error(errBody || res.statusText); } const contentType = res.headers.get("content-type"); @@ -194,15 +194,6 @@ async function handleExternalSignerResponse(res: Response): Promise { } } -function getErrorMessage(errBody: string): string { - try { - const errJson = JSON.parse(errBody) as {message?: string}; - return errJson.message ?? errBody; - } catch (e) { - return errBody; - } -} - function serializerSignableMessagePayload(config: BeaconConfig, payload: SignableMessage): Record { switch (payload.type) { case SignableMessageType.AGGREGATION_SLOT: