|
Author |
Topic: error reporting (Read 264 times) |
|
benelek
|
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
|
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.
|
|
|
|
|