Closed thelinuxlich closed 9 years ago
Can you give more details on what this flag would do?
Why not just let bluebird handle and print them?
I don't know what you mean, bluebird doesn't show the final query.
An example, if I'm debugging a complex ReQL query throwing something like
ReqlDriverError
Cannot convert `undefined` with r.expr().
I need to do something like this
console.log(query.toString());
To see what's going on
In case of undefined
, you can just look at the stracktrace. It will point you to the line that fails.
It also throws in this case because undefined
values are not treated as operational errors like NaN
.
Well, the line that fails is the line containing the whole query before parsing, so it doesn't help much
Is undefined
the only error that bothers you?
No, most of the errors, when dealing with long queries, I need to see the parsed result
Oh I see.
Some errors don't seem to properly bubbled up. I'll fix that and make undefined
an operational error. That should fix your problems I think.
Is this still valid or your latest error patches solved it?
It should be fixed now. Tests are here: https://github.com/neumino/rethinkdbdash/blob/master/test/client-backtrace.js#L70
And backtraces look like this:
Cannot convert `Infinity` to JSON in:
r.db("dd054a14db348f5bcb99bbf14615955c").table("2f66694bbfa2a7bd2f0b0ef0460e7178")
.map(function(var_1) {
return var_1("key").add(Infinity)
^^^^^^^^
})
This will be a life saver!
This would help debugging errors a lot, instead of throwing something like ReqlDriverError messages, also provide the full query parsed by the adapter