Skip to content
  • gmantele's avatar
    [ADQL] Throwing a ParseException instead of an Error · a382b251
    gmantele authored
    when an incorrect character that can not be interpreted by
    the JavaCC Token Manager is encountered.
    
    Actually, the TokenMgrError thrown by JavaCC is caught by all
    ADQLParser.parseQuery(...) functions, wrapped inside a ParseException
    which is finally thrown instead of the TokenMgrError. In this way,
    ADQL-Lib users just have to care about a single Throwable:
    ParseException.
    
    Besides the error message has been slightly modified from:
    
    > Lexical error at line 1, column 10.  Encountered: "\u00e9" (233), after : \"\"
    
    to:
    
    > Incorrect character encountered at l.1, c.10: \"\\u00e9\" ('é'), after : \"\"
    
    Thus, the error is more user-friendly, more easy to understand by users.
    Additionally, the incorrect character is displayed, as before, in its unicode
    expression, but also in its character form (instead of an integer value that
    nobody can really understand).
    
    This commit fixes the GitHub issue #17
    a382b251