[mapguide-internals] Exceptions...

Steve Dang steve.dang at autodesk.com
Tue Apr 10 22:05:02 EDT 2007


Ok, you are right. You need to catch both PHP exception and MG exception.
 
Steve.

	-----Original Message----- 
	From: mapguide-internals-bounces at lists.osgeo.org on behalf of Jason Birch 
	Sent: Tue 4/10/2007 7:49 PM 
	To: MapGuide Internals Mail List 
	Cc: 
	Subject: RE: [mapguide-internals] Exceptions...
	
	

	Thanks Steve,
	
	I really should have been more specific.  I didn't say PHP anywhere.
	
	I was expecting this to throw an exception (not exactly a good polygon):
	
	<?php
	try
	{
	  $wktReaderWriter = new MgWktReaderWriter();
	  $poly = $wktReaderWriter->Read("POLYGON ( ( 1 1 , 2 1 , 1 2 , 1 11 ) )");
	  print $poly->GetArea();
	}
	catch (Exception $ex)
	{
	   print "Exception";
	   exit;
	}
	?>
	
	But it only did when I explicitly tried to catch an MgException rather than a standard PHP Exception.
	
	Jason
	
	________________________________
	
	From: Steve Dang
	Subject: RE: [mapguide-internals] Exceptions...
	
	Hi Jason,
	
	MG tries to catch all third-party exceptions and standard exceptions, then converts them to MgException.
	
	It's a defect if there is an uncaught exception. How does this happen? On Linux?
	
	Thanks,
	Steve.
	



More information about the mapguide-internals mailing list