rescue exceptions and log them