Rather than mysteriously failing, raise exceptions

Possibly with appropriately human readable message,
to let people know what is going on.