Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix unhand error in sigServer #173

Merged
merged 1 commit into from Jul 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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