Get the MessageBird error report data.

@param body Raw request body.
@return Error report, or null if the body can not be deserialized.
17006
private List<ErrorReport> getErrorReportOrNull(final String body) {
        ObjectMapper objectMapper = new ObjectMapper();

        try {
            JsonNode jsonNode = objectMapper.readValue(body, JsonNode.class);
            ErrorReport[] errors = objectMapper.readValue(jsonNode.get("errors").toString(), ErrorReport[].class);

            List<ErrorReport> result = Arrays.asList(errors);

            if (result.isEmpty()) {
                return null;
            }

            return result;
        } catch (IOException e) {
            return null;
        }
    }
882868
public String getDataString() {
        if (exception == null) {
            try {
                if (!setDataString) {
                    dataString = EntityUtils.toString(httpEntity, charset.charset);
                    setDataString = true;
                }
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        return dataString;
    }
1178465
@Override
    public String getMessage() {
        if (message_ != null) {
            return message_;
        }

        if (getCause() != null) {
            return getCause().getMessage();
        }

        switch (code_) {
            case UNSPECIFIED_ERR:
                return "unknown error";
            case NOT_SUPPORTED_ERR:
                return "not supported";
            case SYNTAX_ERR:
                return "syntax error";
            default:
                return null;
        }
    }
1014323
public String getErrorMessage ()
    {
        String msg = getMessage();
        return String.valueOf(_errorCode).equals(msg) ? null : msg;
    }
34250
private static JsJmsMessage decodeBytesBody(String body) throws MessageDecodeFailedException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "decodeBytesBody");
        JsJmsBytesMessage result = new JsJmsBytesMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
        if (body != null)
            result.setBytes(HexString.hexToBin(body, 0));
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "decodeBytesBody");
        return result;
    }
999250
public Object unmarshalThisMessage(String strXMLBody)
    {
        try {
            Reader inStream = new StringReader(strXMLBody);
        
            Object msg = this.unmarshalRootElement(inStream);
        
            inStream.close();
            
            return msg;
        } catch(Throwable ex) {
            ex.printStackTrace();
        }
        return null;    // Error
    }
870009
function getErrorFromBody(body, statusCode, opts) {
  if (typeof body === 'string') {
    try {
      body = JSON.parse(body)
    } catch (e) {
      const stringBody = body
      body = {}
      body.response = stringBody
    }
  }
  // hide token from logs
  if (opts && opts.headers && opts.headers.Authorization) {
    opts.headers.Authorization = 'Token **********'
  }
  body.statusCode = statusCode
  // log the request options to help debugging
  body.request = opts
  if (body.request && body.request.body && Buffer.isBuffer(body.request.body)) {
    body.request.body = '<Buffer...>'
  }
  return new Error(JSON.stringify(body, null, '  '))
}
647416
private MessageEmitSvlt getMessageObj(final HttpServletRequest request,
                                        final MessageResources messages) {
    return (MessageEmitSvlt)StrutsUtil
            .getMessageObj(getId(), this, request,
                           messages,
                           getMessageObjAttrName(),
                           getErrorObjErrProp(),
                           clearMessages());
  }
1130210
private static JsJmsMessage decodeStreamBody(String body) throws MessageDecodeFailedException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "decodeStreamBody");
        JsJmsStreamMessage result = new JsJmsStreamMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
        if (body != null) {
            try {
                StringTokenizer st = new StringTokenizer(body, "&");
                while (st.hasMoreTokens())
                    result.writeObject(decodeObject(st.nextToken()));
            } catch (UnsupportedEncodingException e) {
                FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.WebJsJmsMessageFactoryImpl.decodeStreamBody", "196");
                // This can't happen, as the Exception can only be thrown for an MQ message
                // which isn't what we have.
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "decodeStreamBody");
        return result;
    }
209944
public static ReplyObject error(String message){
		ReplyObject ret = new ReplyObject();
		ret.success = false;
		ret.message = message;
		return ret;
	}
563295
public String getErrorString() {
        StringBuffer ret = new StringBuffer();
        String linesep = System.getProperty("line.separator");

        List<Exception> exc = getExceptions();
        if (exc != null && exc.size() != 0) {

            // ret.append(HBCIUtils.getLocMsg("STAT_EXCEPTIONS")).append(":").append(linesep);
            for (Iterator<Exception> j = exc.iterator(); j.hasNext(); ) {
                ret.append(HBCIUtils.exception2StringShort(j.next()));
                ret.append(linesep);
            }
        }

        HBCIDialogStatus status = getDialogStatus();
        if (status != null) {
            String errMsg = status.getErrorString();
            if (errMsg.length() != 0) {
                ret.append(errMsg + linesep);
            }
        }

        return ret.toString().trim();
    }
1119622
public static String getContentTypeByRequestBody(String body) {
		final ContentType contentType = ContentType.get(body);
		return (null == contentType) ? null : contentType.toString();
	}
376074
public static Response getExceptionResponse(final int status, final String msg) {
		return Response.status(status).entity(new LinkedHashMap<String, Object>() {
			private static final long serialVersionUID = 1L;
			{
				put("code", status);
				put("message", msg);
			}
		}).type(MediaType.APPLICATION_JSON).build();
	}
480946
public static InfluxDBException buildExceptionForErrorState(final InputStream messagePackErrorBody) {
    try {
      MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(messagePackErrorBody);
      ImmutableMapValue mapVal = (ImmutableMapValue) unpacker.unpackValue();
      return InfluxDBException.buildExceptionFromErrorMessage(
          mapVal.map().get(new ImmutableStringValueImpl("error")).toString());
    } catch (Exception e) {
      return new InfluxDBException(e);
    }
  }
1160310
@Override public final InputStream getErrorStream() {
    try {
      HttpEngine response = getResponse();
      if (HttpEngine.hasBody(response.getResponse())
          && response.getResponse().code() >= HTTP_BAD_REQUEST) {
        return response.getResponse().body().byteStream();
      }
      return null;
    } catch (IOException e) {
      return null;
    }
  }
1202892
public byte[] getBytes(){
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getBytes");

    byte[] payload = (byte[])getPayload().getField(JmsBytesBodyAccess.BODY_DATA_VALUE);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
      if (payload == null) {
        SibTr.exit(this, tc, "getBytes", null);
      }
      else {
        SibTr.exit(this, tc, "getBytes", new Object[]{payload, payload.length});
      }
    }
    return payload;
  }
323101
public String getErrorMessage(IOException e) {
    // Prefer to use message from GJRE.
    GoogleJsonResponseException gjre = getJsonResponseExceptionOrNull(e);

    if (gjre != null && gjre.getDetails() != null) {
      return gjre.getDetails().getMessage();
    }
    return e.getMessage();
  }