#163 where have the diagnostics of ExtraContentError gone?

PyXB 1.1.5
closed
None
fixed
Binding model
major
PyXB 1.1.4
defect
2012-08-30
2012-08-29
hhsprings
No

doc = aaa.CreateFromDocument(open("zzz.xml").read())
Traceback (most recent call last):
...
File "/usr/lib/python2.7/site-packages/pyxb/binding/basis.py", line 2077, in append
raise pyxb.ExtraContentError('%s: Extra content %s starting with %s' % (self.ExpandedName, element_binding, value,))
pyxb.exceptions
.ExtraContentError
>>>

Hmm...%s is what?

I hope StructuralBadDocumentError don't eat *args:

class StructuralBadDocumentError (BadDocumentError):
    #...
    def __init__ (self, *args, **kw):
        #...
        BadDocumentError.__init__(self, **kw)

but I hope:

    def __init__ (self, *args, **kw):
        #...
        BadDocumentError.__init__(self, *args, **kw)
        #_______________________________^^^^^^

Is this your intent?

(Maybe this ticket relates #26)

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2012-08-29
    • status changed from new to accepted

    Yes, probably adding *args into that exception would help pass the location information along. If you make that change, does it help? If so I can put it in 1.1.15.

    PyXB's diagnostics are horrible. I'm actively working a complete replacement to the content model which will address #112 and at the same time make huge improvements to the diagnostics. The entire exception hierarchy will be reviewed after that finishes. This will be made available in PyXB 1.2.0, which I hope will be in the next couple weeks.

     
  • hhsprings

    hhsprings - 2012-08-30

    If you make that change, does it help? If so I can put it in 1.1.15.

    Yes. Even if it is "horrible", it will be much better than nothing.

    PyXB 1.2.0, which I hope will be in the next couple weeks.

    I don't know your roadmap from 1.1.5 to 1.2.0, but it's not bad to apply
    as temporary solution in 1.1.5, I think so.

     
  • Peter A. Bigot

    Peter A. Bigot - 2012-08-30
    • status changed from accepted to closed
    • resolution set to fixed

    commit 5cdb7ac2dc2c697247d594d3cb64945f7b6e1398
    Author: Peter A. Bigot <pab@‌>
    Date: Thu Aug 30 03:39:07 2012 -0500

    trac/163: Restore missing exception messages

    Residual from past confusion about whether the exception message should be
    propagated as an argument or a keyword. Temporary solution; exception
    hierarchy will be replaced when addressing trac #26 during 1.2.0
    development.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks