fusion44 / fusion44/blitz_api

Refactor old code to properly raise Exceptions instead of returning error dictionaries

Open
#197 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
Python
Stars
25
Forks
19
PR merge metrics
No merged PRs in 30d

Description

See:
https://github.com/fusion44/blitz_api/blob/72862f8d6a25d0951097e6e3db79e4d0c10cca3f/app/bitcoind/utils.py#L69

Example:
```python
except aiohttp.client_exceptions.ClientConnectionError as e:
return {
"error": f"Aiohttp client connection error: {str(e)}",
"status": status.HTTP_503_SERVICE_UNAVAILABLE,
}
```

utils.py - redis_get():
https://github.com/fusion44/blitz_api/blob/72862f8d6a25d0951097e6e3db79e4d0c10cca3f/app/api/utils.py#L57

This function returns an empty string when a key is not found in Redis. This is not good. An empty string could be a valid value for a key. The caller can get confused whether the result is an error or just an empty string.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked exception-handling code in app/bitcoind/utils.py around line 69 and app/api/utils.py around line 57, then inspect their callers. Trace how connection failures and missing Redis keys are currently handled; done means the affected paths consistently distinguish exceptions from valid return values without relying on error dictionaries or an empty string.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python, redis
Domain
api, backend, database
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.