question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise catch problem

See original GitHub issue

I’m having a problem when creating a Transaction, it is triggering ‘catch’ on Promise but when consoling error message it returns a stringed object.

console.log(err.message);
// Prints "[object Object]"

captura de tela de 2018-01-30 18-34-06

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mccraveirocommented, Feb 1, 2018

An error object should always have a “message”. We definitely need to fix this on pagarme-js

1reaction
vinyguedesscommented, Feb 1, 2018

@henriquekano Thanks for the clue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise.prototype.catch() - JavaScript - MDN Web Docs
The catch() method of a Promise object schedules a function to be called when the promise is rejected. It immediately returns an equivalent ......
Read more >
Error handling with promises
In the task an error is thrown form inside the promise and promise is never settled neither with a resolve nor reject. The...
Read more >
Javascript promise .catch not working
method returns a Promise and deals with rejected cases only. It behaves the same as calling Promise. prototype.
Read more >
Using .then(), .catch(), .finally() to Handle Errors in Javascript ...
A Promise executes immediately and either resolves to a single value, or rejects with an error object. If the promise is rejected, the...
Read more >
Promise Error Handling
Inside the promise, the catch() method will catch the error caused by the throw statement and reject() . If an error occurs and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found