Project

General

Profile

« Previous | Next » 

Revision 52093

check for malformed json

View differences:

modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/HTTPWithFileName/HTTPWithFileNameCollectorIterable.java
68 68

  
69 69
        if(isJson){
70 70
            JSONObject jsonobj = new JSONObject("{'resource':" + meta + "}");
71
            return XML.toString(jsonobj);
71
            try {
72
                return XML.toString(jsonobj);
73
            }catch(Exception e){
74
                log.fatal("Impossible to transform json object to xml \n" + jsonobj + "\n " + e.getMessage());
75
                throw new RuntimeException();
76
            }
72 77
        }
73 78
        return meta;
74 79
    }

Also available in: Unified diff