fix(system): stop native_python impl swallowing errors into None

@logger.catch defaults to reraise=False, so change_password and
get_debug_logs_raw - which raise NotImplementedError - silently
returned None. The service layer's 'except NotImplementedError -> 501'
never fired, yielding '200 null' or a response-model 500 instead.
login likewise turned unexpected errors into a None result.

Drop the pointless decorator from the two methods that only raise, and
let login reraise so failures surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
fusion44 2026-07-03 21:44:25 +02:00
parent c4afca50e9
commit cf423f52c1
No known key found for this signature in database
2 changed files with 39 additions and 3 deletions

View file

@ -69,7 +69,7 @@ class NativePythonSystem(SystemBase):
# return an empty connection info object for now
return Ok(ConnectionInfo())
@logger.catch(exclude=(HTTPException,))
@logger.catch(exclude=(HTTPException,), reraise=True)
async def login(self, i: LoginInput) -> Result[Dict[str, str], Report]:
# https://github.com/fusion44/blitz_api/issues/255
pw = config("BAPI_NATIVE_LOGIN_PASSWORD", cast=str)
@ -108,11 +108,11 @@ class NativePythonSystem(SystemBase):
)
)
@logger.catch(exclude=(HTTPException,))
async def change_password(self, type: str, old_password: str, new_password: str):
# no @logger.catch: NotImplementedError must propagate to the service
# layer (which turns it into a 501), not be swallowed into a None return
raise NotImplementedError()
@logger.catch(exclude=(HTTPException,))
async def get_debug_logs_raw(self) -> RawDebugLogData:
raise NotImplementedError()