Skip to content

Commit

Permalink
refactor(manifests): use new methods in manifest exception handling (#…
Browse files Browse the repository at this point in the history
…983)

* refactor(manifests): use new methods in manifest exception handling

Uses the newInstance method on the SpinnakerException to clean up some exception handling in ArtifactDownloaderImpl.

* refactor(manifest): formatter

Ran formatter, deleted unnecessary import.

---------

Co-authored-by: Richard Timpson <richard.timpson@salesforce.com>
  • Loading branch information
richard-timpson and Richard Timpson authored May 2, 2023
1 parent 119dcac commit e6db28a
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.netflix.spinnaker.kork.core.RetrySupport;
import com.netflix.spinnaker.kork.exceptions.SpinnakerException;
import com.netflix.spinnaker.kork.retrofit.Retrofit2SyncCall;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException;
import com.netflix.spinnaker.rosco.services.ClouddriverService;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -50,10 +49,8 @@ public void downloadArtifactToFile(Artifact artifact, Path targetFile) throws IO
artifact, e.getMessage()),
e);
}
} catch (SpinnakerHttpException e) {
throw new SpinnakerHttpException(downloadFailureMessage(artifact, e), e);
} catch (SpinnakerException e) {
throw new SpinnakerException(downloadFailureMessage(artifact, e), e);
throw e.newInstance(downloadFailureMessage(artifact, e));
}
}

Expand Down

0 comments on commit e6db28a

Please sign in to comment.