From ca0086ce9d73cd508b1166820e4bf0c221995660 Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Tue, 19 Sep 2023 10:20:28 +0300 Subject: [PATCH] Update prefix message in 'fetchContentWithoutToken' --- .../bitbucket/BitbucketAuthorizingFileContentProvider.java | 2 +- .../factory/server/scm/AuthorizingFileContentProvider.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/wsmaster/che-core-api-factory-bitbucket/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketAuthorizingFileContentProvider.java b/wsmaster/che-core-api-factory-bitbucket/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketAuthorizingFileContentProvider.java index 66e03c8bcdd..bdee138fcc9 100644 --- a/wsmaster/che-core-api-factory-bitbucket/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketAuthorizingFileContentProvider.java +++ b/wsmaster/che-core-api-factory-bitbucket/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketAuthorizingFileContentProvider.java @@ -61,7 +61,7 @@ public String fetchContent(String fileURL) throws IOException, DevfileException requestURL.substring(requestURL.indexOf(split[6]) + split[6].length() + 1), token.getToken()); } catch (UnknownScmProviderException e) { - return fetchContentWithoutToken(requestURL, e); + return fetchContentWithoutToken(requestURL); } catch (ScmCommunicationException e) { return toIOException(fileURL, e); } catch (ScmUnauthorizedException diff --git a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/scm/AuthorizingFileContentProvider.java b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/scm/AuthorizingFileContentProvider.java index 3cae6931813..ddc67b185cb 100644 --- a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/scm/AuthorizingFileContentProvider.java +++ b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/scm/AuthorizingFileContentProvider.java @@ -92,7 +92,7 @@ private String fetchContent( return urlFetcher.fetch(requestURL, authorization); } } catch (UnknownScmProviderException e) { - return fetchContentWithoutToken(requestURL, e); + return fetchContentWithoutToken(requestURL); } catch (ScmCommunicationException e) { return toIOException(fileURL, e); } catch (ScmUnauthorizedException @@ -102,7 +102,7 @@ private String fetchContent( } } - protected String fetchContentWithoutToken(String requestURL, UnknownScmProviderException e) + protected String fetchContentWithoutToken(String requestURL) throws DevfileException, IOException { // we don't have any provider matching this SCM provider // so try without secrets being configured @@ -122,8 +122,7 @@ protected String fetchContentWithoutToken(String requestURL, UnknownScmProviderE throw exception; } } - throw new DevfileException( - String.format("%s: %s", e.getMessage(), exception.getMessage()), exception); + throw new DevfileException("Could not reach devfile at " + " `" + exception.getMessage() + "`", exception); } }