throw new ForbiddenException("Http error " + code
+ " when executing request");
}
if (code == 404) {
throw new NotFoundException("Http error " + code
+ " when executing request");
}
if (code == 405) {
throw new MethodNotAllowedException("Http error " + code