Open lkitching opened 5 years ago
Sounds sensible.
I have, on occasion, matched the message by regex to capture a variety of errors/ not be tied to the specific copy on the message but I see no reason why the ex-data
couldn't be handled with at least as much flexibility.
I presume grafter-server will present the ex-data
in it's json response and logs? We're not going to loose anything are we?
This approach was definitely useful for testing missing-column validations in 689660c.
As we discussed off thread, it'd be nice to have something like a thrown-with-ex-data?
method for assert-expr
that somehow let's you match against the ex data.
A number of tests make assertions on the messages of thrown exceptions using the
thrown-with-msg?
handler in order to discern the underlying reason for the error. Most exceptions have an associated data map so encode the reason within the data and update the tests to match on the data instead.