Task #2271
closedPlan Structured Exception Storage
100%
Description
In 2.y and currently on 3.0-dev branches, Exception objects are stored inconsistently. It is backed by two json fields. One is for storing non-fatal exceptions, and another is for storing a single fatal exception field.
When saving an exception, the exception type will give you different types of information. Here are the current behaviors:
Exception -- you'll get the entire traceback as one string. It includes the Exception name and message, but it's not structured which means the API can't structure it easily either. The traceback is logged once in the logs.
PulpException -- same as exception
PulpCodedException -- you'll save a dictionary with the following keys: 'code', 'description', 'data', and 'sub_errors'. What you won't save is the type (besides the 'code') or message (maybe that's 'description'?) or the traceback in any way. The traceback is logged once in the logs, but regularly we have users who are not the admins and don't know where the logs are try to find that one line. Also sub_errors allows for recursive nesting.
With ^ in mind here are some questions:
- Do we want a dictionary in all exception cases with 'traceback' and 'message' as keys?
- Should 'code' also be there but be None when not set?
- Do we want to keep sub_errors and the recursive storage?
- Should we structure tracebacks better or is this a client side issue?
Updated by semyers about 8 years ago
As this relates to the REST API, http://www.django-rest-framework.org/api-guide/exceptions/ has some guidance on how to make sure what we come up with is well-represented in the API.
Updated by jortel@redhat.com about 8 years ago
- Sprint/Milestone changed from 27 to 28
Updated by dkliban@redhat.com about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dkliban@redhat.com
Added by dkliban@redhat.com about 8 years ago
Added by dkliban@redhat.com about 8 years ago
Revision 9a37b213 | View on GitHub
Replaces PulpCodedException with PulpException
The new PulpException should be used as a base class for each Pulp coded exception.
Updated by dkliban@redhat.com about 8 years ago
- Status changed from ASSIGNED to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|9a37b213c2527fdbb0f2dec47f2e3d436e48be54.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Replaces PulpCodedException with PulpException
The new PulpException should be used as a base class for each Pulp coded exception.
closes #2271 https://pulp.plan.io/issues/2271