Skip to content

Commit

Permalink
provide more intuitive error message when JFrog feed is inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi committed Sep 29, 2023
1 parent 7385230 commit 65d25b4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/code/V3ServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,11 +1474,23 @@ private JsonElement[] GetJsonElementArr(string request, string propertyName, out
}
catch (Exception e)
{
errRecord = new ErrorRecord(
exception: e,
"GetResponsesFromRegistrationsResourceFailure",
if (e.Message.Contains("'<' is an invalid start of a value"))
{
// scenario where the feed is not active anymore, i.e confirmed for JFrogArtifactory. The default error message is not intuitive.
errRecord = new ErrorRecord(
exception: new Exception($"JSON response from repository {Repository.Name} could not be parsed due to the feed being inactive or invalid, with inner exception: {e.Message}"),
"FindVersionGlobbingFailure",
ErrorCategory.InvalidResult,
this);
}
else
{
errRecord = new ErrorRecord(
exception: e,
"GetResponsesFromRegistrationsResourceFailure",
ErrorCategory.InvalidResult,
this);
}
}

return entries;
Expand Down

0 comments on commit 65d25b4

Please sign in to comment.