Logging errors alongside the failure counter will ensure no raised exceptions get lost or hidden by the caller.