Open kevzettler opened 6 years ago
Hey @kevzettler - sorry for the trouble. Hmm. Async/await should not complicate how errors are handled, because async methods are just returning promises and exceptions are transformed into promise rejections.
What I see from your output is that your code is throwing an error of type OperationalError
. Is it possible that your OperationalError is not stringifying itself nicely? The loopback-console code for printing errors is very simple, using just console.log.
If you send me a small sample project reproducing the problem I'd be happy to dig in deeper!
@doublemarked the promises in use here are from the BlueBird promise library: https://github.com/petkaantonov/bluebird
OperationalError seems to stem from that. https://github.com/petkaantonov/bluebird/blob/master/docs/docs/api/operationalerror.md
looks like we are trying to use generic Errors for OperationalError:
declare class OperationalError extends Error {}
Any further thoughts?
Can you put together a small sample project demonstrating the problem? I'd be happy to then debug and fix it.
my app uses es7 async await all over the place with try/catch exception handling in the async/await code. When an exception is thrown in the console the output is mangled. The exception message is output as an array instead of a string or something. example below.