We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi I was just wondering 2 things: 1. Is there a list of supported exception types? I'm wanting to wrap some int parsing in a try catch 2. Very general question I know but just wondering what people would "usually" do exception reporting/handling wise for notification purposes?
Answers
@jameswest -- you said:
Without seeing your code (which you can share if you like) you probably want
NumberFormatException
. Here is a Java discussion that might be comparable to your Processing case:In Processing,
catch
uses Java built-in exceptions. You can see this from thecatch
reference documentationHere is a general tutorial on Java exceptions and a list of the builtin exceptions:
Thanks Jeremy most appreciated.. how much of Java is supported in Processing?
@jameswest --
The vast majority of Java is supported in Processing -- which is run through a pre-processor to be converted into Java when a sketch is built. You may import standard Java libraries, include pure Java tabs, and even write Processing sketches in full IDEs like Eclipse or Netbeans (with the proper setup and configuration).
Example past discussion:
We can use
static
members in a nested class in a ".pde" file as long as we declare itstatic
as well. L-)Another way to get
static
members in nested classes is viaextends
.Notice also that inner classes can actually have
static
final
fields declared inside it, as long as they're initialized w/ known compile-time constants! :-bdOr, you can just catch the base class, Exception.