[PATCH v6 09/19] test: Separate out the exception handling