| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -252,7 +252,8 @@ static private StringList breakCommas(String contents) { | |||
| 252 | 252 | * @param fussy true if it should show an error message if bad size() | |
| 253 | 253 | * @return null if there was an error, otherwise an array (might contain some/all nulls) | |
| 254 | 254 | */ | |
| 255 | - static public SizeInfo parseSketchSize(String code, boolean fussy) { | ||
| 255 | + static public SizeInfo parseSketchSize(String code, | ||
| 256 | + boolean fussy) throws SketchException { | ||
| 256 | 257 | // This matches against any uses of the size() function, whether numbers | |
| 257 | 258 | // or variables or whatever. This way, no warning is shown if size() isn't | |
| 258 | 259 | // actually used in the applet, which is the case especially for anyone | |
@@ -299,8 +300,8 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings | |||
| 299 | 300 | } | |
| 300 | 301 | } | |
| 301 | 302 | if (closeBrace == -1) { | |
| 302 | - // throw new SketchException("Found a { that's missing a matching }"); | ||
| 303 | - return null; | ||
| 303 | + throw new SketchException("Found a { that's missing a matching }", false); | ||
| 304 | + // return null; | ||
| 304 | 305 | } | |
| 305 | 306 | searchArea = sb.toString(); | |
| 306 | 307 | } | |
@@ -323,19 +324,20 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings | |||
| 323 | 324 | // making a square sketch window? Not going to | |
| 324 | 325 | ||
| 325 | 326 | if (info.hasOldSyntax()) { | |
| 326 | - return null; | ||
| 327 | + // return null; | ||
| 328 | + throw new SketchException("Please update your code to continue.", false); | ||
| 327 | 329 | } | |
| 328 | 330 | ||
| 329 | 331 | if (info.hasBadSize() && fussy) { | |
| 330 | 332 | // found a reference to size, but it didn't seem to contain numbers | |
| 331 | 333 | final String message = | |
| 332 | - "The size of this applet could not automatically\n" + | ||
| 333 | - "be determined from your code. Use only numeric\n" + | ||
| 334 | - "values (not variables) for the size() command.\n" + | ||
| 335 | - "See the size() reference for an explanation."; | ||
| 334 | + "The size of this sketch could not be determined from your code.\n" + | ||
| 335 | + "Use only numbers (not variables) for the size() command.\n" + | ||
| 336 | + "Read the size() reference for more details."; | ||
| 336 | 337 | Base.showWarning("Could not find sketch size", message, null); | |
| 337 | 338 | // new Exception().printStackTrace(System.out); | |
| 338 | - return null; | ||
| 339 | + // return null; | ||
| 340 | + throw new SketchException("Please fix the size() line to continue.", false); | ||
| 339 | 341 | } | |
| 340 | 342 | ||
| 341 | 343 | info.checkEmpty(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments