1
1
Fork 0
mirror of https://github.com/mjl-/mox.git synced 2025-04-21 13:39:45 +03:00
mox/junk
Mechiel Lukkien a2c79e25c1
check and log errors more often in deferred cleanup calls, and log remote-induced errors at lower priority
We normally check errors for all operations. But for some cleanup calls, eg
"defer file.Close()", we didn't. Now we also check and log most of those.
Partially because those errors can point to some mishandling or unexpected code
paths (eg file unexpected already closed). And in part to make it easier to use
"errcheck" to find the real missing error checks, there is too much noise now.

The log.Check function can now be used unconditionally for checking and logging
about errors. It adjusts the log level if the error is caused by a network
connection being closed, or a context is canceled or its deadline reached, or a
socket deadline is reached.
2025-03-24 14:06:05 +01:00
..
bloom.go check and log errors more often in deferred cleanup calls, and log remote-induced errors at lower priority 2025-03-24 14:06:05 +01:00
bloom_test.go check and log errors more often in deferred cleanup calls, and log remote-induced errors at lower priority 2025-03-24 14:06:05 +01:00
filter.go check and log errors more often in deferred cleanup calls, and log remote-induced errors at lower priority 2025-03-24 14:06:05 +01:00
filter_test.go do not use results from junk filter if we have less than 50 positive classifications to base the decision on 2025-01-23 22:55:50 +01:00
parse.go check and log errors more often in deferred cleanup calls, and log remote-induced errors at lower priority 2025-03-24 14:06:05 +01:00
parse_test.go switch to slog.Logger for logging, for easier reuse of packages by external software 2023-12-14 13:45:52 +01:00