[geos-devel] Exceptions
Yury A. Bychkov
me at yury.ca
Sat Apr 19 04:23:52 EDT 2003
Yes, exceptions in GEOS hasn't been uniformized yet. The reason why they are in
different forms is simple: in JTS code some exceptions have their own classes
(e.g. AssertionFailedException) and for these I've created a corresponding class
in GEOS, and some are native java exceptions and for them I use strings. I was
originally planning to create classes for all exceptions later, but if strings
are better, then I can change everything to strings.
Yury
----- Original Message -----
From: "Paul Ramsey" <pramsey at refractions.net>
To: "GEOS List" <geos-devel at geos.refractions.net>
Sent: Saturday, April 19, 2003 12:22 AM
Subject: [geos-devel] Exceptions
> The exceptions continue to muck with us. Exceptions thrown in geos have
> not been catchable, and are taking down the postgres backend with
> sigabort. I did a grep for "throw" in the source code, and the
> exceptions are a bit of a mishmash. Most of them are of the form,
>
> throw "PointCoordinateList exception: can't retrieve element\n";
>
> But some are of the form,
>
> throw new ParseException(e.toString());
>
> or
>
> throw ParseException("Expected number but encountered ')'")
>
> So, sometimes we are throwing strings, sometimes we are throwing new
> exception objects and other times just static things?
>
> Anyhow, we have had better luck catching the simple throws (the
> strings). Is there a reason for throwing specially constructed
> exception objects?
>
>
> Paul Ramsey
> Refractions Research
> Email: pramsey at refractions.net
> Phone: (250) 885-0632
>
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
More information about the geos-devel
mailing list