RESTWS-310: Fixed exception handling