Skip to content

Commit

Permalink
fix: fix unhand error in sigServer (#173)
Browse files Browse the repository at this point in the history
Co-authored-by: wangbing <wangbing@cryptape.com>
  • Loading branch information
solargatsby and wangbing committed Jul 20, 2021
1 parent b7fb620 commit 4a79e89
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions offchain-modules/packages/app-multisign-server/src/sigServer.ts
Expand Up @@ -213,14 +213,16 @@ export async function startSigServer(configPath: string): Promise<void> {
return;
}

let status: responseStatus = 'success';
const sigRsp = jsonRPCResponse.result as SigResponse;
if (sigRsp.Error.Code === SigErrorCode.Ok) {
jsonRPCResponse.result = sigRsp.Data;
} else {
status = 'failed';
jsonRPCResponse.result = undefined;
jsonRPCResponse.error = { code: sigRsp.Error.Code, message: sigRsp.Error.Message };
let status: responseStatus = 'failed';
if (!jsonRPCResponse.error) {
const sigRsp = jsonRPCResponse.result as SigResponse;
if (sigRsp.Error.Code === SigErrorCode.Ok) {
jsonRPCResponse.result = sigRsp.Data;
status = 'success';
} else {
jsonRPCResponse.result = undefined;
jsonRPCResponse.error = { code: sigRsp.Error.Code, message: sigRsp.Error.Message };
}
}

res.json(jsonRPCResponse);
Expand Down

0 comments on commit 4a79e89

Please sign in to comment.