You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2004/02/12 00:10:46 UTC

cvs commit: jakarta-jmeter/src/functions/org/apache/jmeter/functions FileWrapper.java CSVRead.java

sebb        2004/02/11 15:10:46

  Modified:    src/functions/org/apache/jmeter/functions FileWrapper.java
                        CSVRead.java
  Log:
  Improve error reporting
  
  Revision  Changes    Path
  1.5       +23 -2     jakarta-jmeter/src/functions/org/apache/jmeter/functions/FileWrapper.java
  
  Index: FileWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/FileWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FileWrapper.java	10 Feb 2004 00:35:12 -0000	1.4
  +++ FileWrapper.java	11 Feb 2004 23:10:45 -0000	1.5
  @@ -196,6 +196,27 @@
       }
   
       /**
  +     * Gets the current row number (mainly for error reporting)
  +     * 
  +     * @param file
  +     * @return the current row number for this thread
  +     */
  +    public static int getCurrentRow(String file)
  +    {
  +    	
  +		Map my = (Map) filePacks.get();
  +		FileWrapper fw = (FileWrapper) (my).get(file);
  +		if (fw == null) // Not yet open
  +		{
  +			return -1;
  +		}
  +		else
  +		{
  +			return fw.currentRow;
  +		}
  +    }
  +    
  +    /**
        * 
        */
       public static void clearAll()
  
  
  
  1.13      +7 -4      jakarta-jmeter/src/functions/org/apache/jmeter/functions/CSVRead.java
  
  Index: CSVRead.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/CSVRead.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CSVRead.java	10 Feb 2004 00:35:12 -0000	1.12
  +++ CSVRead.java	11 Feb 2004 23:10:46 -0000	1.13
  @@ -134,11 +134,14 @@
           }
           catch (NumberFormatException e)
           {
  -            log.warn("Column number error: " + columnOrNext + " "+ e.toString());
  +            log.warn(Thread.currentThread().getName()+" - can't parse column number: " 
  +                     + columnOrNext + " "+ e.toString());
           }
   		catch (IndexOutOfBoundsException e)
   		{
  -			log.warn("Invalid column number: " + columnOrNext + " "+ e.toString());
  +			log.warn(Thread.currentThread().getName()+" - invalid column number: " + columnOrNext
  +			          + " at row " + FileWrapper.getCurrentRow(fileName) + " "
  +			          + e.toString());
   		}
   
           log.debug("execute value: "+myValue);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org