Status code 501 for Unsupported/Not implemented

The NotSupportedError should use HTTP return code 501, not 500.

Change-Id: I40261a1636f0477d778a96f3d9625a5ce3b3252c
This commit is contained in:
Harald Jensås 2025-05-12 14:14:05 +02:00
parent 77ea046fdf
commit aece5508c6
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,7 @@
---
fixes:
- |
The HTTP status code for NotSupportedError has been fixed. The generic
``500 Internal Server Error`` status code was previously used, it will now
use the ``501 Not Implemented`` status code.

View File

@ -29,8 +29,8 @@ class AliasAccessError(FishyError):
class NotSupportedError(FishyError):
"""Feature not supported by resource driver"""
def __init__(self, msg='Unsupported'):
super().__init__(msg)
def __init__(self, msg='Unsupported', code=501):
super().__init__(msg, code)
class NotFound(FishyError):