FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Suggestions
   Software Suggestions
(Moderator: fry)
   error reporting
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: error reporting  (Read 264 times)
benelek

35160983516098 WWW Email
error reporting
« on: Mar 9th, 2003, 9:20am »

when P5 finds an error in your code during runtime, it will tell you where in the code it occurred.
 
consider the following code, and where the error occurs:
Code:

void setup() {
  size(100,100);
}
 
int[] theArray = new int[5];
 
void loop() {
  for(int i=0; i<theArray.length; i++) {
    println(theArray[i]); //an error occurs here.
  }
}

 
now look at the following modification:
Code:

void setup() {
  size(100,100);
}
 
void loop() {
  theFunction(); //the error is reported as occurring here.
}
 
void theFunction() {
  int[] theArray = new int[5];
  for(int i=0; i<theArray.length; i++) {
    println(theArray[i]); //an error occurs here.
  }
}

 
in more complicated functions where a similar error occurs, it gets pretty hard to find out where exactly in the function the error occurs.
 
fry


WWW
Re: error reporting
« Reply #1 on: Mar 25th, 2003, 4:26pm »

this is because of java's just-in-time compiler sometimes mangling the line numbers, so the last line number in the stack trace gets reported. we'll need an option to disable the jit. added to the list.
 
Pages: 1 

« Previous topic | Next topic »