Test rewriting of error codes