Open
Description
API Issue Report
Title
GET /api/v1/settings/sources/{id} – Internal Server Error when accessing non-existing ID
Description
When performing a GET
request to /api/v1/settings/sources/{id}
using a non-existing or invalid ID, the API returns a 500 Internal Server Error
.
Instead, the server should handle the request gracefully and respond with a proper status code like 404 Not Found
along with a meaningful error message, indicating that the record does not exist.
Preconditions
- Framework: Laravel (Krayin-based)
- Endpoint:
GET /api/v1/settings/sources/{id}
- Invalid/non-existing ID is used (e.g.,
/sources/53
in this case)
Steps to Reproduce
- Make a
GET
request to/api/v1/settings/sources/{invalid-id}
. - Observe the response:
{ "message": "Attempt to read property \"id\" on null", "exception": "ErrorException", "file": ".../DelegatesToResource.php", "line": 139, ... }
Expected Result
- API should return:
with HTTP status code
{ "message": "Source not found" }
404 Not Found
.
Actual Result
- API returns:
- HTTP status:
500 Internal Server Error
- Message:
"Attempt to read property \"id\" on null"
- HTTP status:
Metadata
Metadata
Assignees
Labels
No labels