more useful errors for logging