Skip to content

Promise-Returning Calls Missing Rejection Handlers #90

@MadhuNimmo

Description

@MadhuNimmo

While analyzing the code using a static analysis tool, I found multiple Promise-returning calls for which rejection is not properly handled.

Affected Files and Lines:
examples/SnapBi/snapBiDirectDebitPayment.js: lines 107, 118, 128
examples/SnapBi/snapBiVaCreation.js: lines 106, 115, 125
examples/SnapBi/SnapBiQrisPayment.js: lines 78, 87, 97

This can lead to unobserved rejections and silent failures in production.

Example:

SnapBi.directDebit()
  .withBody(directDebiRequestBody)
  .withAccessToken("your access token")
  .createPayment(externalId)
  .then(r => {
    console.log("Snap Bi result: " + JSON.stringify(r, null, 2));
  }); // <-- no await or rejection handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions