@Override public void deleteTestCase(String id) { try { testCaseStore.delete(id, 0); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e); } catch (IResourceStore.ResourceModifiedException e) { log.debug(e.getLocalizedMessage(), e); throw new NoLogWebApplicationException(Response.Status.CONFLICT); } catch (IResourceStore.ResourceNotFoundException e) { log.debug(e.getLocalizedMessage(), e); throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } } }
@Override public URI updateTestCase(String id, TestCase testCase) { try { testCaseStore.update(id, 0, testCase); return RestUtilities.createURI(resourceURI, id, versionQueryParam, 0); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e); } catch (IResourceStore.ResourceNotFoundException e) { log.debug(e.getLocalizedMessage(), e); throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } catch (IResourceStore.ResourceModifiedException e) { log.debug(e.getLocalizedMessage(), e); throw new NoLogWebApplicationException(Response.Status.CONFLICT); } }
throw new NotFoundException(e.getLocalizedMessage()); } catch (IResourceStore.ResourceModifiedException e) { log.debug(e.getLocalizedMessage(), e); throw new BadRequestException(e.getLocalizedMessage());
private Response throwConflictException(String id, IResourceStore.ResourceModifiedException e) { try { IResourceStore.IResourceId currentId = resourceStore.getCurrentResourceId(id); throw RestUtilities.createConflictException(resourceURI, currentId); } catch (IResourceStore.ResourceNotFoundException e1) { throw new NotFoundException(e.getLocalizedMessage(), e); } }