piston hijacks any TypeError raised by MAAS

Bug #1228205 reported by Raphaël Badin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Raphaël Badin

Bug Description

When a TypeError is raised inside MAAS (indicative of a serious bug), piston hijacks it and returns a response with a 400 status code and a content that looks like this:
"""
Piston/0.2.3rc1 (Django 1.5.4) crash report:

Method signature does not match.

Resource does not expect any parameters.
"""

This is really suboptimal as it obscures the root cause of the error. Even with PISTON_DISPLAY_ERRORS set you don't get the full stacktrace.

Tags: api log

Related branches

Revision history for this message
Raphaël Badin (rvb) wrote :

The culprit piston's error_handler() method in resource.py (/usr/share/pyshared/piston/resource.py in the package). The docstring says it can be overridden. We should definitely do that and code up something more sensible (maybe replacing it with an empty method would be all that is needed).

tags: added: log
tags: added: api
Raphaël Badin (rvb)
Changed in maas:
assignee: nobody → Raphaël Badin (rvb)
status: Triaged → Fix Committed
Raphaël Badin (rvb)
Changed in maas:
milestone: none → 14.04
Changed in maas:
status: Fix Committed → Fix Released
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.