Handle exceptions with different log levels