You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great for the module, when it encounters an error, to throw an Error object containing a documented error code.
This would enable user code to reliably try... catch each module method and handle each error type specifically. Currently, this is not possible, with each method returning null on error, and the error information being displayed separately with console.log.
I'd be happy to implement this myself but I don't currently have the time on my hands. So, I thought it prudent to raise the issue here as a matter of recordkeeping if nothing more.
By the way, thanks to @DiegoZoracKy for providing this module. It's great. 👍
The text was updated successfully, but these errors were encountered:
Hi @ChrisTalman, I'm sorry for taking so long to give you an answer. I totally missed this. The code of this module is very old (I believe this is the first module I published), and its style is really missing some important parts as you pointed out. You are totally right.
The promise based methods are already properly using reject in case of errors, and are not logging anything. The methods decode and encode should indeed return Error without sending anything out to stdout(console.log). Would you like to send a PR with this changes? Don't worry if you don't have the time. Just let me know.
It would be great for the module, when it encounters an error, to
throw
anError
object containing a documented error code.This would enable user code to reliably
try... catch
each module method and handle each error type specifically. Currently, this is not possible, with each method returningnull
on error, and the error information being displayed separately withconsole.log
.I'd be happy to implement this myself but I don't currently have the time on my hands. So, I thought it prudent to raise the issue here as a matter of recordkeeping if nothing more.
By the way, thanks to @DiegoZoracKy for providing this module. It's great. 👍
The text was updated successfully, but these errors were encountered: