Tests on error catching