[FE-2671] `shell` and `eval` throw error if handling error not an FaunaHTTPError
ptpaterson opened this issue · 1 comments
Error handling for the shell
and eval
commands assumes that the error contains a requestResult
field. This field is only present in the FaunaHTTPError
sub class. If the error is not a FaunaHTTPError
, then the console output is
Cannot read properties of undefined (reading 'responseRaw')
triggered here:
fauna-shell/src/commands/eval.js
Line 63 in 956f7e0
and here:
fauna-shell/src/commands/shell.js
Line 109 in 956f7e0
example
An example is in the event the client handles a timeout (rather than receiving a 503 http response). In that case, the js driver returns a TimeoutError.
other notes
The runQueries
function always throws a QueryError
object, so checking if error
is a FaunaHTTPError
will always return false here
fauna-shell/src/commands/shell.js
Line 115 in 7b8b185
though error.faunaError
could be.
Internal ticket number is FE-2671