Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java @ 102:9140017e8962
fix bug with empty username. add logging for JSON exceptions.
author | casties |
---|---|
date | Thu, 09 Feb 2017 20:46:15 +0100 |
parents | 7268c3ca025b |
children | 7417f5915181 |
comparison
equal
deleted
inserted
replaced
101:7268c3ca025b | 102:9140017e8962 |
---|---|
177 } | 177 } |
178 // make sure id is not set for POST | 178 // make sure id is not set for POST |
179 jo.remove("id"); | 179 jo.remove("id"); |
180 // create Annotation object from posted JSON | 180 // create Annotation object from posted JSON |
181 annot = createAnnotation(jo, entity); | 181 annot = createAnnotation(jo, entity); |
182 } catch (IOException e1) { | 182 } catch (IOException e) { |
183 logger.warning(e.toString()); | |
183 setStatus(Status.SERVER_ERROR_INTERNAL); | 184 setStatus(Status.SERVER_ERROR_INTERNAL); |
184 return null; | 185 return null; |
185 } catch (JSONException e) { | 186 } catch (JSONException e) { |
187 logger.warning(e.toString()); | |
186 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); | 188 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); |
187 return null; | 189 return null; |
188 } | 190 } |
189 if (annot == null) { | 191 if (annot == null) { |
190 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); | 192 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); |