[PATCH v2 33/43] test: Separate out the exception handling