Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #974 from zalando/ARUHA-1997
Browse files Browse the repository at this point in the history
ARUHA-1997: Extended the catched exception range;
  • Loading branch information
v-stepanov authored Nov 13, 2018
2 parents 0779692 + e3585db commit 92bb248
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.joda.time.DateTimeZone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
Expand All @@ -15,9 +15,9 @@
import org.zalando.nakadi.annotations.DB;
import org.zalando.nakadi.domain.EventType;
import org.zalando.nakadi.domain.EventTypeBase;
import org.zalando.nakadi.exceptions.runtime.DuplicatedEventTypeNameException;
import org.zalando.nakadi.exceptions.runtime.InternalNakadiException;
import org.zalando.nakadi.exceptions.runtime.NoSuchEventTypeException;
import org.zalando.nakadi.exceptions.runtime.DuplicatedEventTypeNameException;
import org.zalando.nakadi.repository.EventTypeRepository;

import java.io.IOException;
Expand Down Expand Up @@ -49,7 +49,7 @@ public EventType saveEventType(final EventTypeBase eventTypeBase) throws Interna
return eventType;
} catch (final JsonProcessingException e) {
throw new InternalNakadiException("Serialization problem during persistence of event type", e);
} catch (final DuplicateKeyException e) {
} catch (final DataIntegrityViolationException e) {
throw new DuplicatedEventTypeNameException("EventType " + eventTypeBase.getName() + " already exists.", e);
}
}
Expand Down

0 comments on commit 92bb248

Please sign in to comment.