--cache-exclude-status can't exclude failures that have no status code
Given a file with the following unresolveable domain name:
https://llkalsaslasdbasdbasdb.google.com
And having lychee configured to ignore error status when caching via
cache_exclude_status = [
"..100",
"104..200",
"300..600",
]
I get the following error
[ERROR] https://llkalsaslasdbasdbasdb.google.com/ | Network error: error sending request for url (https://llkalsaslasdbasdbasdb.google.com/) Maybe a certificate error?
And the following cache entry
❯ cat .lycheecache | grep llkalsaslasdbasdbasdb
https://llkalsaslasdbasdbasdb.google.com/,,1754564166
As there is no status code returned, there is currently no way to exclude these error from being cached.
lychee should provide a way to ignore these failures, too.
(I tried to use the empty string in cache_exclude_status, but that fails when the config is parsed)
Alternatively, errors without a status code should never be cacheable. I don't know if there's any unexpected side effect from that, but the cache entry certainly looks weird.
Alternatively, errors without a status code should never be cacheable.
Agree, that's a good solution.
I would like to hear some more opinions on this first before making any bad decisions. I have a track record for those. 😅