Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ htmlcov/
.DS_Store
__pycache__/
*.pyc
__pycache__/
*.pyo

# local environment
.env
.venv/
venv/

# logs
*.log

# type checking
.mypy_cache/
10 changes: 9 additions & 1 deletion buckaroo/_buckaroo_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

import logging
from typing import Optional
from .exceptions._authentication_error import AuthenticationError
from .config.buckaroo_config import BuckarooConfig, create_config_from_mode
Expand Down Expand Up @@ -118,7 +120,13 @@ def confirm_credential(self) -> bool:
try:
response = self.http_client.get("/json/Transaction/Specification/ideal")
return response.success
except Exception:
except Exception as e:
logging.warning(
"confirm_credential: unexpected error during credential check "
"(network issue or unexpected API response): %s",
e,
exc_info=True,
)
return False

def get_config_info(self) -> dict:
Expand Down
3 changes: 2 additions & 1 deletion buckaroo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BuckarooConfig:
retry_attempts: int = 3

@classmethod
def from_env(cls) -> "BuckarooConfig":
def from_env(cls) -> 'BuckarooConfig':
"""Create configuration from environment variables."""
# Get log level from env
log_level_str = os.getenv("BUCKAROO_LOG_LEVEL", "INFO").upper()
Expand Down Expand Up @@ -240,3 +240,4 @@ def __exit__(self, exc_type, exc_val, exc_tb):
self.logger.log_exception(exc_val, context={"context_manager": "exit"})
else:
self.logger.log_debug("Exiting Buckaroo app context successfully")

Loading
Loading