use of io.gravitee.management.service.exceptions.EventNotFoundException in project gravitee-management-rest-api by gravitee-io.
the class EventServiceImpl method findById.
@Override
public EventEntity findById(String id) {
try {
LOGGER.debug("Find event by ID: {}", id);
Optional<Event> event = eventRepository.findById(id);
if (event.isPresent()) {
return convert(event.get());
}
throw new EventNotFoundException(id);
} catch (TechnicalException ex) {
LOGGER.error("An error occurs while trying to find an event using its ID {}", id, ex);
throw new TechnicalManagementException("An error occurs while trying to find an event using its ID " + id, ex);
}
}
Aggregations