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

portico-gateway.js swallowing errors and running callback multiple times #22

Open
charlie-s opened this issue Jun 28, 2018 · 1 comment

Comments

@charlie-s
Copy link

charlie-s commented Jun 28, 2018

In lib/services/portico-gateway.js, PorticoGateway.submitTransaction, we have this block:

try {
    callback(null, {header: h, body: gatewayResult['Ver1.0'][0].Transaction[0]});
} catch (e) {
    callback(null, {header: h});
}

As you can see, any errors thrown in the callback are swallowed and the callback is then run a 2nd time. What does the try/catch accomplish here?

@slogsdon
Copy link
Contributor

@charlie-s Apologies for missing this originally! Agreed that the try/catch block there isn't a good solution for these cases. We're working on a small update to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants