use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class HistoricJobLogResourceImpl method getHistoricJobLog.
public HistoricJobLogDto getHistoricJobLog() {
HistoryService historyService = engine.getHistoryService();
HistoricJobLog historicJobLog = historyService.createHistoricJobLogQuery().logId(id).singleResult();
if (historicJobLog == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Historic job log with id " + id + " does not exist");
}
return HistoricJobLogDto.fromHistoricJobLog(historicJobLog);
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class GroupResourceImpl method updateGroup.
public void updateGroup(GroupDto group) {
ensureNotReadOnly();
Group dbGroup = findGroupObject();
if (dbGroup == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Group with id " + resourceId + " does not exist");
}
group.update(dbGroup);
identityService.saveGroup(dbGroup);
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class TenantResourceImpl method updateTenant.
public void updateTenant(TenantDto tenantDto) {
ensureNotReadOnly();
Tenant tenant = findTenantObject();
if (tenant == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Tenant with id " + resourceId + " does not exist");
}
tenantDto.update(tenant);
identityService.saveTenant(tenant);
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogResourceImpl method getHistoricExternalTaskLog.
@Override
public HistoricExternalTaskLogDto getHistoricExternalTaskLog() {
HistoryService historyService = engine.getHistoryService();
HistoricExternalTaskLog historicExternalTaskLog = historyService.createHistoricExternalTaskLogQuery().logId(id).singleResult();
if (historicExternalTaskLog == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Historic external task log with id " + id + " does not exist");
}
return HistoricExternalTaskLogDto.fromHistoricExternalTaskLog(historicExternalTaskLog);
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class FetchAndLockHandlerImpl method errorTooManyRequests.
protected void errorTooManyRequests(AsyncResponse asyncResponse) {
String errorMessage = "At the moment the server has to handle too many requests at the same time. Please try again later.";
// status code 429 would fit better
InvalidRequestException invalidRequestException = new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, errorMessage);
asyncResponse.resume(invalidRequestException);
}
Aggregations