Skip to content

Commit

Permalink
refactor(retrofit/test): added no-arg constructor for SpinnakerException
Browse files Browse the repository at this point in the history
  • Loading branch information
SheetalAtre committed Aug 22, 2023
1 parent 1b4b862 commit 49d62ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ public SpinnakerHttpException(String message, SpinnakerHttpException cause) {
* with {@link com.netflix.spinnaker.kork.retrofit.ErrorHandlingExecutorCallAdapterFactory}.
*/
public <T> SpinnakerHttpException(retrofit2.Response<T> syncResp, retrofit2.Retrofit retrofit) {
super(
syncResp.code() + " " + syncResp.message(),
new Throwable(syncResp.code() + " " + syncResp.message()));
this.retrofit2Response = syncResp;
this.response = null;
this.retrofit = retrofit;
Expand Down Expand Up @@ -153,7 +150,9 @@ public String getMessage() {
// always returns something whether there's a specified message or not, so
// look at getRawMessage instead.
if (getRawMessage() == null) {
return super.getMessage();
if (super.getMessage() != null) {
return super.getMessage();
}
}

if (retrofit2Response != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public SpinnakerServerException(Throwable cause) {
super(cause);
}

public SpinnakerServerException() {}

@Override
public SpinnakerServerException newInstance(String message) {
return new SpinnakerServerException(message, this);
Expand Down

0 comments on commit 49d62ce

Please sign in to comment.