[mapguide-internals] RE: Exception in FeatureReader
Traian Stanev
traian.stanev at autodesk.com
Tue May 5 16:12:27 EDT 2009
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
More information about the mapguide-internals
mailing list