comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/rest/CreateResource.java @ 555:408fd2cb7bb5

Added error message with create exception
author mschaefer
date Thu, 14 Jun 2018 15:30:53 +0200
parents 415df0fc4fa1
children 584591f8203c
comparison
equal deleted inserted replaced
554:673d3bf7eb11 555:408fd2cb7bb5
103 db.createArtifactWithFactory(factory, 103 db.createArtifactWithFactory(factory,
104 getCallMeta(), 104 getCallMeta(),
105 inputDocument)); 105 inputDocument));
106 } 106 }
107 catch (ArtifactDatabaseException adbe) { 107 catch (ArtifactDatabaseException adbe) {
108 logger.error("Create artifact failed", adbe);
108 Response response = getResponse(); 109 Response response = getResponse();
109 response.setStatus( 110 response.setStatus(
110 Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY, adbe.getMessage()); 111 Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY, adbe.getMessage());
111 return new EmptyRepresentation(); 112 return new EmptyRepresentation();
112 } 113 }

http://dive4elements.wald.intevation.org