Task #6043
Story #3944: DataONE Python products
Handle pyxb.UnrecognizedDOMRootNodeError exception
0%
Description
It is possible for an attempt to deserialize a DataONE type to cause a pyxb.UnrecognizedDOMRootNodeError exception. If that happens, the exception is not caught in d1_common. Client code typically only catches the d1_common.types.exceptions.DataONEException base exception or children and so will crash on pyxb.UnrecognizedDOMRootNodeError. So d1_common should catch pyxb.UnrecognizedDOMRootNodeError and wrap it up as a DataONEException before sending it to the client.
History
#1 Updated by Roger Dahl over 10 years ago
- Status changed from New to Rejected
- translation missing: en.field_remaining_hours set to 0.0
This exception is derived from PyXBException, which we're already catching. I investigated this and the cause was that I was using the PyXB CreateFromObject() method directly in my script while I should have been using the deserialize() method on your PyXB exceptions wrapper.