Ignore:
Timestamp:
03/09/06 09:28:43 (19 years ago)
Author:
remar
Message:
  • parseErrorString doesn't die on strange error strings anymore! (I hope)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/internal/OMCParser.java

    r387 r402  
    6969        throws UnexpectedReplyException
    7070    {
     71        if(errorString.equals(""))
     72        {
     73            throw new UnexpectedReplyException("Empty error message");
     74        }
     75       
    7176        StringTokenizer strTok = new StringTokenizer(errorString, "\r\n");
     77       
     78        if(strTok.countTokens() == 0)
     79        {
     80            throw new UnexpectedReplyException("Empty error message");
     81        }
     82       
    7283        CompileError[] compileErrs = new CompileError[strTok.countTokens()];
    7384       
     
    94105            String[] errorParts = errorLine.split("]");
    95106           
    96             if(errorParts.length < 2)
     107            if(errorParts.length != 2)
    97108            {
    98109                throw new UnexpectedReplyException("Weird error message from "+
     
    134145             *   that the line and column numbers can be found.
    135146             */
     147            if(errorLocationParts[1].length() == 0)
     148            {
     149                throw new UnexpectedReplyException("Weird error message from " +
     150                        "the compiler: [" + errorLine + "]");
     151            }
     152           
    136153            char startCharacter = errorLocationParts[1].charAt(0);
    137154            int infoOffset;
     
    166183            {
    167184                ErrorManager.logError(e);
     185                throw new UnexpectedReplyException("Weird error message from"+
     186                        " the compiler: [" + errorLine + "]");
    168187            }
    169188           
Note: See TracChangeset for help on using the changeset viewer.