BBMRI-ERIC / negotiator

An Open-source access negotation system for Research Infrastructures
https://negotiator.bbmri-eric.eu
GNU Affero General Public License v3.0
4 stars 8 forks source link

[BUG] Wrong error message format when forbidden or not found #244

Closed svituz closed 1 week ago

svituz commented 6 months ago

Describe the bug

When trying to access negotiations for another user, the Forbidden response structure is wrong. The same happens when acccessing a negotiations that doesn't exist

How to reproduce

What happens The response contains the following JSON structure

{
    "timestamp": "2024-03-21",
    "status": 403,
    "error": "Forbidden",
    "trace": ".....<very long stack trace>",
    "message": "403 FORBIDDEN",
    "path": "/api/v3/users/2/negotiations"
}

What should happen The response should have the common error structure

{
  "type": "",
  "title": "",
  "details": "",
  "status": ""
}

NOTE To reproduce the bug for Unauthorized use the endpoint /api/v3/negotiations/unkn