Skip to content

Commit

Permalink
[MRESOLVER-91] Error messages not clear when not reattempting resolut…
Browse files Browse the repository at this point in the history
…ion when a previous attempt failed and the failure was cached

For users that were not aware or did not understand well the
ResolutionErrorPolicy, the error messages that were presented when this
policy was enforced, ie a resolution was not reattempted due to a
previous failure that was cached, could be difficult to understand.

This closes s4u#37
  • Loading branch information
gaganis authored and michael-o committed Jun 20, 2020
1 parent b418a7b commit 55fa2d7
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,18 @@ private ArtifactTransferException newException( String error, Artifact artifact,
{
if ( error == null || error.length() <= 0 )
{
return new ArtifactNotFoundException( artifact, repository, "Failure to find " + artifact + " in "
+ repository.getUrl() + " was cached in the local repository, "
+ "resolution will not be reattempted until the update interval of " + repository.getId()
return new ArtifactNotFoundException( artifact, repository, artifact
+ " was not found in " + repository.getUrl() + " during a previous attempt. This failure was"
+ " cached in the local repository and"
+ " resolution is not reattempted until the update interval of " + repository.getId()
+ " has elapsed or updates are forced", true );
}
else
{
return new ArtifactTransferException( artifact, repository, "Failure to transfer " + artifact + " from "
+ repository.getUrl() + " was cached in the local repository, "
+ "resolution will not be reattempted until the update interval of " + repository.getId()
return new ArtifactTransferException( artifact, repository, artifact + " failed to transfer from "
+ repository.getUrl() + " during a previous attempt. This failure"
+ " was cached in the local repository and"
+ " resolution is not reattempted until the update interval of " + repository.getId()
+ " has elapsed or updates are forced. Original error: " + error, true );
}
}
Expand Down Expand Up @@ -322,16 +324,18 @@ private MetadataTransferException newException( String error, Metadata metadata,
{
if ( error == null || error.length() <= 0 )
{
return new MetadataNotFoundException( metadata, repository, "Failure to find " + metadata + " in "
+ repository.getUrl() + " was cached in the local repository, "
+ "resolution will not be reattempted until the update interval of " + repository.getId()
return new MetadataNotFoundException( metadata, repository, metadata + " was not found in "
+ repository.getUrl() + " during a previous attempt."
+ " This failure was cached in the local repository and"
+ " resolution is not be reattempted until the update interval of " + repository.getId()
+ " has elapsed or updates are forced", true );
}
else
{
return new MetadataTransferException( metadata, repository, "Failure to transfer " + metadata + " from "
+ repository.getUrl() + " was cached in the local repository, "
+ "resolution will not be reattempted until the update interval of " + repository.getId()
return new MetadataTransferException( metadata, repository, metadata + "failed to transfer from "
+ repository.getUrl() + " during a previous attempt."
+ " This failure was cached in the local repository and"
+ " resolution will not be reattempted until the update interval of " + repository.getId()
+ " has elapsed or updates are forced. Original error: " + error, true );
}
}
Expand Down

0 comments on commit 55fa2d7

Please sign in to comment.