[PATCH v4 10/19] test: Separate out the exception handling