code: private void signalObjectError(WebContext ctx, HttpResponseStatus status, String message) {
          if (ctx.getRequest().method() == HEAD) {
              ctx.respondWith().status(status);
          } else {
              ctx.respondWith().error(status, message);
          }
          log.log(ctx.getRequest().method().name(),
                  message + " - " + ctx.getRequestedURI(),
                  APILog.Result.ERROR,
                  CallContext.getCurrent().getWatch());
      }
docs: Writes an API error to the log