michael-o commented on a change in pull request #148:
URL: https://github.com/apache/maven-resolver/pull/148#discussion_r795941204
##########
File path:
maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java
##########
@@ -40,13 +42,32 @@
*
* @param expected The expected checksum as declared by the hosting
repository, may be {@code null}.
* @param actual The actual checksum as computed from the local bytes, may
be {@code null}.
+ * @deprecated Does not reveal expected checksum kind, use other
constructor that provide that information as well.
*/
+ @Deprecated
public ChecksumFailureException( String expected, String actual )
{
- super( "Checksum validation failed, expected " + expected + " but is "
+ actual );
+ this( expected, null, actual );
+ }
+
+ /**
+ * Creates a new exception with the specified expected, expected kind and
actual checksum. The resulting exception
+ * is {@link #isRetryWorthy() retry-worthy}.
+ *
+ * @param expected The expected checksum as declared by the hosting
repository, may be {@code null}.
+ * @param expectedKind The expected checksum kind, may be {@code null}.
+ * @param actual The actual checksum as computed from the local bytes, may
be {@code null}.
+ * @since 1.8.0
+ */
+ public ChecksumFailureException( String expected, String expectedKind,
String actual )
+ {
+ super( "Checksum validation failed, expected '"
+ + expected + "'" + ( expectedKind == null ? "" : " (" +
expectedKind + ")" )
+ + " but is '" + actual + "' (actual)" );
Review comment:
Last optimization fo consistency: `+ " but is actually '" + actual + "'"
);` since we also write the term 'expected' first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]