Skip to content

Commit

Permalink
suppress and log the proposal error (#24)
Browse files Browse the repository at this point in the history
* suppress and log the proposal error

* version bump
  • Loading branch information
mdtanrikulu authored Oct 13, 2020
1 parent 0a9a52e commit fb72b0a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"bluebird": "^3.5.0",
"dayjs": "^1.8.31",
"ts-node": "^9.0.0",
"yajsapi": "0.1.0-alpha.1"
"yajsapi": "0.1.0-alpha.2"
},
"devDependencies": {
"tsconfig-paths": "^3.9.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yajsapi",
"version": "0.1.0-alpha.1",
"version": "0.1.0-alpha.2",
"description": "NodeJS API for Next Golem",
"repository": "https://github.com/golemfactory/yajsapi",
"main": "dist/index.js",
Expand Down
19 changes: 14 additions & 5 deletions yajsapi/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,13 @@ export class Engine {
proposal.id(),
proposal.issuer(),
];
// with contextlib.suppress(Exception):
await proposal.reject();
emit_progress("prop", "rejected", proposal_id, provider_id);
try {
await proposal.reject();
emit_progress("prop", "rejected", proposal_id, provider_id);
} catch(error) {
//suppress and log the error and continue;
logger.log('debug', `Reject error: ${error}`);
}
continue;
}
if (proposal.is_draft()) {
Expand All @@ -328,8 +332,13 @@ export class Engine {
proposal
);
} else {
await proposal.respond(builder.props(), builder.cons());
emit_progress("prop", "respond", proposal.id());
try {
await proposal.respond(builder.props(), builder.cons());
emit_progress("prop", "respond", proposal.id());
} catch(error) {
//suppress and log the error and continue;
logger.log('debug', `Respond error: ${error}`);
}
}
}
}
Expand Down

0 comments on commit fb72b0a

Please sign in to comment.