Menu

Rationale behind Flat2XML error handling

Help
Anonymous
2004-04-02
2004-04-02
  • Anonymous

    Anonymous - 2004-04-02

    I am playing around more with Flat2XML stage. I have a correct file that has 227 fields and I tried to upload a file that has 205 fields. Babeldoc detects this and throws a ton of exception, BUT it does not register an error and goes through the next stage, it simply says Skipping .............

    Why is this ? How do I detect this kind of error then ?

     
    • Anonymous

      Anonymous - 2004-04-02

      Ok I took a look at the source file : FlatFileConverter.java and the relevant method is
      Document toXml method where the try catch has the following :

      catch (Exception e) {
            errorComment(root, e);
          }

      I would think that this should rethrow the exception rather than return a possibly damaged document object. Comments ?

       
    • Anonymous

      Anonymous - 2004-04-02

      Wrong place it's actually this ( same file ) :
        private void handleNonSegmented(Element root, String[] paragraph) {
          Element rowElement = root.addElement(getUnmarshaller().getRowElement());

          try {
            convert(rowElement, paragraph);
          } catch (ConversionException ce) {
            errorComment(rowElement, ce);
           
      --> Exception is swallowed. This is bad in my opinion
          

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.