Skip to content

Commit

Permalink
Catch the newly thrown NotFoundException when checking for exisiting …
Browse files Browse the repository at this point in the history
…configs
  • Loading branch information
Michael Graff committed Nov 16, 2017
1 parent 457724b commit 538709f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.netflix.kayenta.storage.ObjectType;
import com.netflix.kayenta.storage.StorageService;
import com.netflix.kayenta.storage.StorageServiceRepository;
import com.netflix.spinnaker.kork.web.exceptions.NotFoundException;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -112,7 +113,7 @@ public CanaryConfigUpdateResponse storeCanaryConfig(@RequestParam(required = fal

try {
configurationService.loadObject(resolvedConfigurationAccountName, ObjectType.CANARY_CONFIG, canaryConfigId);
} catch (IllegalArgumentException e) {
} catch (NotFoundException e) {
configurationService.storeObject(resolvedConfigurationAccountName, ObjectType.CANARY_CONFIG, canaryConfigId, canaryConfig, canaryConfig.getName() + ".json", false);

return CanaryConfigUpdateResponse.builder().canaryConfigId(canaryConfigId).build();
Expand Down

0 comments on commit 538709f

Please sign in to comment.