Skip to content

Commit

Permalink
Revert error handling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Apr 4, 2024
1 parent 127909d commit facf88c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/validator/src/util/externalSignerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export async function externalSignerUpCheck(remoteUrl: string): Promise<boolean>
async function handleExternalSignerResponse<T>(res: Response): Promise<T> {
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");
Expand All @@ -194,15 +194,6 @@ async function handleExternalSignerResponse<T>(res: Response): Promise<T> {
}
}

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<string, unknown> {
switch (payload.type) {
case SignableMessageType.AGGREGATION_SLOT:
Expand Down

0 comments on commit facf88c

Please sign in to comment.