Added hasFailed and solve a problem with ex::what() using sstream