exception handling - checking for restclient exception