[PATCH v7 5/8] test: Separate out the exception handling