Note in http://openslide.org/docs/newformat/#error-handling that assertions can & should be used to check invariants that have already been enforced by an earlier error return.