Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] How to distinguish between a fresh and cached "artifact not found"?

Hi Benjamin,

thanks for the advice.

>> Now, the use case for the above is error reporting. Currently, we log a
>> warning message to the Eclipse Error Log whenever model resolution
>> fails. If it fails because there really was not model for library X,
>> that warning is warranted. However, when I just attempted to resolve
>> five minutes ago, got a negative response, cached it
>> (setNotFoundCachingEnabled), and am now trying to resolve again, I
>> wouldn't want another warning to show up in the Error Log (at most, this
>> warrants a debug-level message).
> 
> I see, makes sense.
> 
>> Thus, I want to be able to distinguish between the two cases.
> 
> Unfortunately, checking the exception message itself is the only easy
> way right now to make this distinction. The exception messages aren't
> localized, so while not beauty, this approach should work reliably.

yes, that's I figured based on my experiments. Anyways, do you think it
would make sense to add this feature to Aether? In the simplest case,
having a subtype of ArtifactNotFoundException (the
ArtifactResolutionException's cause) that encodes the "cached negative
reponse" case would do the trick.

Best wishes,

Andreas

-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top