Get status code from correct exception.