Skip to content

Commit

Permalink
Revert exception type change due to its inconvenience for scm file re…
Browse files Browse the repository at this point in the history
…solving service (#126)

Signed-off-by: Max Shaposhnik <mshaposh@redhat.com>
  • Loading branch information
mshaposhnik authored Sep 20, 2021
1 parent a79cc94 commit adadf59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public PersonalAccessToken fetchPersonalAccessToken(Subject cheSubject, String s
| ScmItemNotFoundException
| ScmBadRequestException
| ConflictException e) {
LOG.error(e.getMessage(), e);
LOG.error(e.getMessage());
throw new ScmCommunicationException(e.getMessage(), e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,17 @@ public String fetchContent(String fileURL) throws IOException, DevfileException
} catch (ScmUnauthorizedException | UnknownScmProviderException e) {
throw new DevfileException(e.getMessage(), e);
} catch (ScmCommunicationException e) {
throw new DevfileException(
e.getMessage(),
new ScmCommunicationException(
String.format(
"Failed to fetch a content from URL %s. Make sure the URL"
+ " is correct. For private repository, make sure authentication is configured."
+ " Additionally, if you're using "
+ " relative form, make sure the referenced file are actually stored"
+ " relative to the devfile on the same host,"
+ " or try to specify URL in absolute form. The current attempt to authenticate"
+ " request, failed with the following error message: %s",
fileURL, e.getMessage())));
throw new IOException(
String.format(
"Failed to fetch a content from URL %s. Make sure the URL"
+ " is correct. For private repository, make sure authentication is configured."
+ " Additionally, if you're using "
+ " relative form, make sure the referenced file are actually stored"
+ " relative to the devfile on the same host,"
+ " or try to specify URL in absolute form. The current attempt to authenticate"
+ " request, failed with the following error message: %s",
fileURL, e.getMessage()),
e);
}
}
}
Expand Down

0 comments on commit adadf59

Please sign in to comment.