class ErrorMap {

    public static String from(String rawMsg) {
        if (rawMsg.matches("^\\s*\\<.*")) {
            return parseWith(rawMsg, new XmlMapper());
        }
        if (rawMsg.matches("^\\s*\\{.*")) {
            return parseWith(rawMsg, new ObjectMapper());
        }
        return rawMsg;
    }

    private  ErrorMap();

}