MAAS doesn't have a consistent error response format in the API

Bug #1353495 reported by Jason Hobbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Low
Unassigned

Bug Description

MAAS is good about returning HTTP Error codes in error conditions, but it lacks a consistent format for error message content or type. Some errors cause plain/text strings to be returned, some cause application/json strings to be returned, some have no content at all.

MAAS should have a consistent format, probably a json object, something like

{
   errors: [{"message": "Frobnication failed.", "code": 42}]
}

This would allow API consumers to have generic error handling and reporting.

Also, this should be documented.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

I have often thought the same thing. We need to return json exactly as you suggest I think.

Changed in maas:
status: New → Triaged
importance: Undecided → Medium
tags: added: api tech-debt
summary: - MAAS doesn't have a consistent error response format
+ [API] MAAS doesn't have a consistent error response format
Changed in maas:
milestone: none → 2.3.x
importance: Medium → High
tags: added: track
Revision history for this message
Adam Collard (adam-collard) wrote : Re: [API] MAAS doesn't have a consistent error response format

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
Changed in maas:
status: Invalid → New
Changed in maas:
importance: High → Low
milestone: 2.3.x → none
status: New → Triaged
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote (last edit ):

While we recognise the inconsistencies, improving this would change the API in ways that go beyond a simple bugfix. This item is added to our internal backlog for further prioritisation (internal ref. PF-3904)

Changed in maas:
status: Triaged → Invalid
summary: - [API] MAAS doesn't have a consistent error response format
+ MAAS doesn't have a consistent error response format in the API
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.