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