[PATCH v5 10/20] test: Separate out the exception handling