Bug 1583761 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I think the answer is it depends on a case-by-case basis.

When an error is caused by invalid input, i.e. it breaches with the
types and bounds checks described in WebDriver, they should generally
be coerced to `ErrorStatus::InvalidArgument`. This is the case, I
think, in the concrete example you linked to because we expect
`profile` to take one particular shape and it the mistake is clearly
on the user’s side.

There are other cases where the input is not at fault, e.g.
hypothetically imagining that we were unable to write the provided
Base64-encoded profile to disk, and where it is appropriate to use
`ErrorStatus::UnknownError` for the lack of a more specific error
code in WebDriver.

Does that make sense?
I think the answer is it depends on a case-by-case basis.

When an error is caused by invalid input, i.e. it breaches with the
types and bounds checks described in WebDriver, it should generally
be coerced to `ErrorStatus::InvalidArgument`. This is the case in
the concrete example you linked to because we expect `profile` to
take one particular shape and the mistake is clearly on the user’s
side.

There are other cases where the input is not at fault, e.g.
hypothetically imagining that we were unable to write the provided
Base64-encoded profile to disk, and where it is appropriate to use
`ErrorStatus::UnknownError` for the lack of a more specific error
code in WebDriver.

Does that make sense?

Back to Bug 1583761 Comment 1