code: public static HttpResponseException errorWithoutStack(final int code, final String errorMessage) {
          return new HttpResponseException() {
              public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
                  rsp.sendError(code, errorMessage);
              }
          };
      }
docs: Sends an error without a stack trace.
  @since 1.215
  @see #error(int, String)