Swirrl / table2qb

A generic pipeline for converting tabular data into rdf data cubes
Eclipse Public License 1.0
13 stars 4 forks source link

Match exceptions by data instead of message #92

Open lkitching opened 5 years ago

lkitching commented 5 years ago

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.

Robsteranium commented 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?

Robsteranium commented 4 years ago

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.