[mapguide-internals] RE: Exception in FeatureReader
Haris Kurtagic
haris at sl-king.com
Tue May 5 16:28:40 EDT 2009
Traian,
Yes, stylizer uses MG_CATCH macro which doesn't handle FDO exceptions.
I thought to submit ticket for this. I wanted to check trunk before
doing so, but I can't access osgeo site right now.
Thank you,
Haris
-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org
[mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Traian
Stanev
Sent: Tuesday, May 05, 2009 10:12 PM
To: MapGuide Internals Mail List
Subject: [mapguide-internals] RE: Exception in FeatureReader
Hi Haris,
The comment (which is mine) used to be correct, at least at the time of
writing the code under it. The stylization code used to catch the
FdoException in cases of (for example) null values, but that behavior
was probably later changed, making the comment out-of-date. The reason
for the comment is that the Stylizer does not (did not?) know about
MgExceptions, because it's used in places that don't know about
MgExceptions, hence the conversion of the MgException to FdoException. I
guess at this point, you can try simply removing the RSFR_TRY and
RSFR_CATCH.
Traian
-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org
[mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Haris
Kurtagic
Sent: Tuesday, May 05, 2009 2:56 PM
To: MapGuide Internals Mail List
Subject: [mapguide-internals] Exception in FeatureReader
Hi,
It seems there is wrong exception handled in RSMgFeatureReader class.
It is demonstrated in such way that exceptions generated inside FDO
provider reader will not be properly handled inside MG, inside Stylizer.
It means in MG log real descritpion of error will not be written (only
unclasified exception).
Reason for this is that in RSMgFeatureReader MG exception is converted
back to FDO exception which is not then undrstood by stylizer.
This conversion is done in macro and suprisngly it works exactly oposite
of what is written in comment lines in RSMgFeatureReader.cpp
//we want to catch the MgException and rethrow a FdoException which
//the Stylizer knows how to catch and release. It does not know about
//MgExceptions so it can't properly release them
#define RSFR_TRY() try {
#define RSFR_CATCH() } \
catch (MgException* ex) \
{ \
ex->Release(); \
throw FdoException::Create();\
}
FdoException is not then caught by stylizer and unclasified exception
goes into log file.
I was testing this against 2.0.2 and wanted to check with trunk but
osgeo site looks dead right now.
Haris
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
More information about the mapguide-internals
mailing list