Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

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

@charlie-s

Description

@charlie-s

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions