logError: provide inner error when present