Changeset 1491

Show
Ignore:
Timestamp:
11/27/08 04:21:36 (6 weeks ago)
Author:
bderenzi
Message:

Updated the XForm parser so that it now outputs a bit more information when there's an error. (e.g. if a label doesn't have a translation for both languages, it now outputs which label is troublesome)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/dev/javarosa/org.javarosa.xform/src/org/javarosa/xform/parse/XFormParser.java

    r1482 r1491  
    309309                        binding = (DataBinding)bindingsByID.get(bind); 
    310310                        if (binding == null) { 
    311                                 throw new XFormParseException("XForm Parse: invalid binding ID"); 
     311                                throw new XFormParseException("XForm Parse: invalid binding ID '" + bind + "'"); 
    312312                        } 
    313313                } else if (ref != null) { 
     
    361361                                if (!(hasITextMapping(f, textRef) || 
    362362                                                (hasITextMapping(f, textRef + ";long") && hasITextMapping(f, textRef + ";short")))) 
    363                                         throw new XFormParseException("<label> text is not localizable for all locales"); 
     363                                        throw new XFormParseException("<label> '" + textRef + "': text is not localizable for all locales"); 
    364364                                q.setLongTextID(textRef + ";long", null); 
    365365                                q.setShortTextID(textRef + ";short", null); 
     
    383383                                if (!(hasITextMapping(f, textRef) || 
    384384                                                (hasITextMapping(f, textRef + ";long") && hasITextMapping(f, textRef + ";short")))) 
    385                                         throw new XFormParseException("<label> text is not localizable for all locales"); 
     385                                        throw new XFormParseException("<label> '" + textRef + "': text is not localizable for all locales"); 
    386386                                g.setLongTextID(textRef + ";long", null); 
    387387                                g.setShortTextID(textRef + ";short", null); 
     
    433433 
    434434                                                if (!hasITextMapping(f, textRef)) 
    435                                                         throw new XFormParseException("<label> text is not localizable for all locales"); 
     435                                                        throw new XFormParseException("<label> '" + textRef + "': text is not localizable for all locales"); 
    436436                                        } else { 
    437437                                                throw new XFormParseException("malformed ref for <item>");