catching TypeError hides root cause

Bug #376770 reported by Edwin Grubbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restful
Triaged
Low
Unassigned

Bug Description

In _operation.py, catching the TypeError can hide errors in toDataForJSON() methods defined for new custom types. It would be nice to either log the the original traceback or include some of its info with the new TypeError.

        try:
            import pdb; pdb.set_trace()
            json_representation = simplejson.dumps(
                result, cls=ResourceJSONEncoder)
        except TypeError:
            raise TypeError("Could not serialize object %s to JSON." %
                            result)

Changed in lazr.restful:
status: New → Triaged
importance: Undecided → Low
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.