This is in regards to writing a custom cache extension that implements the interface: railo.commons.io.cache.Cache
The method getCacheEntry(String key) is to throw an exception of type IOException "when entry does not exist or is stale". That's fine, and easy to implement but the problem is that for every cache miss, I get an error dumped into my logs. In addition to the overhead of file I/O for every miss, I don't want all those entries in my logs for what is basically an expected and recoverable error. Now, that being said, if my cache provider does run into some other non-recoverable error that prevents it from being able to access the underlying cache engine and needs to throw that error, I would like it to be in the logs.
Therefore, I would like to submit the idea that the getCacheEntry methods throw two types of exceptions, a new one called KeyNotFound and the standard IOException.
This will allow Railo to differentiate between a recoverable exception that doesn't need to be logged (KeyNotFound) and something bad that should be logged, and hopefully rethrown (IOException).
This is a similar approach I am already taking in my cache provider so I can tell the difference between an exception that simply indicates the key was not found and an exception that means something really bad happened.