Project

General

Profile

Revision 1ee58da8

ID1ee58da89ec0d7e3f523fec73cd24a34ba35db2c
Parent b3e21c63
Child d2be662d

Added by Katja Luther over 1 year ago

ref #8182: add header to failed response

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/OccurrenceListController.java
231 231
        logger.info("doListSpecimensOrObservations() - " + request.getRequestURI());
232 232

  
233 233
        if(accessionNumber == null ) {
234
            response.setHeader("Failure", "Query must be given");
234 235
            HttpStatusMessage.create("Query must be given", 400).send(response);
235 236
            return null;
236 237
        }
237 238

  
238 239
       FieldUnitDTO fieldUnitDto = service.findByAccessionNumber(accessionNumber, null,this.initializationStrategy);
240
       if(fieldUnitDto == null ) {
241
           response.setHeader("Failure", "No DNA available for accession number ");
242
           HttpStatusMessage.create("No DNA available for accession number " + accessionNumber, 400).send(response);
243
           return null;
244
       }
239 245
       return fieldUnitDto;
240 246
    }
241 247

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)