Timeline for Calling token API
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 17, 2019 at 18:42 | comment | added | Developer | in your version, I'll have a try catch outside or catch expression at the caller level of requestToken, appreciate if you can add that part just for a comprehensive deal. | |
Feb 17, 2019 at 18:40 | vote | accept | Developer | ||
Feb 17, 2019 at 6:28 | comment | added | Magnus Jeffs Tovslid | Your code didn't handle any errors, it just turned them into rejections. My version also does this. About try catch inside a new promise. Anything you don't reject yourself will be swallowed. For example, if credentials is null, you will get a swallowed exception. | |
Feb 16, 2019 at 19:51 | comment | added | Developer |
I didn't get you on You should always have a try-catch inside a new Promise, otherwise exceptions are swallowed. please explain more. I think my code try catch is inside.
|
|
Feb 16, 2019 at 19:51 | comment | added | Developer | thanks but I don't see any error handlings, it's never a smooth ride, what if things goes wrong? my code was around all possibilites of errors, from json parsing, to http errors and returning it to the caller | |
Feb 16, 2019 at 11:22 | history | answered | Magnus Jeffs Tovslid | CC BY-SA 4.0 |