|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51904 Can't get message from com_exception
Submitted: 2010-05-25 08:29 UTC Modified: 2020-01-27 17:36 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: spyfox dot home at gmail dot com Assigned:
Status: Open Package: COM related
PHP Version: 5.3.2 OS: Windows XP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: spyfox dot home at gmail dot com
New email:
PHP Version: OS:


 [2010-05-25 08:29 UTC] spyfox dot home at gmail dot com
I have simple script with using COM object "Scripting.FileSystemObject" that usually used in JScript (VBscript).
It's work fine, but when I try to catch error (Folder doesn't exist) I can't get error message :(

Sorry for my bad english :)

Test script:
        $FS = new COM('Scripting.FileSystemObject');
        $fold = $FS->GetFolder('f:/bash');
        $folds = $fold->SubFolders();
        foreach($folds as $sf)
            echo $sf->name . '<br>';
    catch(com_exception $e)
        echo 'Error msg: ', $e->getMessage();

Expected result:
Error msg: Path not found

Actual result:
Error msg: Source: Unknown Description: Unknown


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-15 15:44 UTC]
-Summary: Can't get mesaage from com_exception +Summary: Can't get message from com_exception
 [2020-01-27 17:36 UTC]
I can confirm the reported behavior (PHP-7.4).

The problem is that the calling IDispatch_Invoke()[1] does neither
populate the bstrSource nor the bstrDescription member of the
EXCEPINFO.  Still, the scode member holds 0x800A004C
(CTL_E_PATHNOTFOUND), which may be used to retrieve a more useful
error message.

[1] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 12 22:01:30 2024 UTC