#45704 [Com]: $exception->getCode() always return 0x80020009 even when it shouldn't

From: Date: Mon, 16 Feb 2009 09:27:13 +0000
Subject: #45704 [Com]: $exception->getCode() always return 0x80020009 even when it shouldn't
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133864@lists.php.net to get a copy of this message
ID: 45704 Comment by: tceverling at yahoo dot co dot uk Reported By: tceverling at yahoo dot co dot uk Status: Open Bug Type: COM related Operating System: Windows XP SP2 PHP Version: 5.2.6 New Comment: This bug is still present in "Apache/2.2.10 (Win32) PHP/5.2.8", Windows XP SP3. We are still unable to use the codes provided by the thrown exceptions to provide alternative paths or give meaningful messages either to the user or to an error log. Previous Comments: ------------------------------------------------------------------------ [2008-08-04 07:30:18] tceverling at yahoo dot co dot uk Description: ------------ When a COM object throws an exception, the getCode() always return 0x80020009 even when it should be some other value. This is reproducible with "Scripting.FileSystemObject", "Scripting.Dictionary" and "Autodesk.MgSdfToolkit". Reproduce code: --------------- echo 'For "Scripting.FileSystemObject".'; try { $fso = new COM("Scripting.FileSystemObject"); $f = $fso->GetFile("c:\\does not exist.txt"); } catch (Exception $e) { //print_r($e); echo dechex($e->getCode()); } echo 'For "Scripting.Dictionary".'; try { $d = new COM("Scripting.Dictionary"); $d->Remove("b"); } catch (Exception $e) { //print_r($e); echo dechex($e->getCode()); } Expected result: ---------------- For 'Scripting.FileSystemObject': 800A0035 For 'Scripting.Dictionary': 800A802B Actual result: -------------- For 'Scripting.FileSystemObject': 80020009 For 'Scripting.Dictionary': 80020009 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45704&edit=1

« previous php.bugs (#133864) next »