Skip to content

Error Handling Not working #713

Description

@iamved777

Hi!
I have checked various issues in issues section but not found proper method for handle errors.

try {
            
    $mailbox = new Mailbox($hoststring, 'example@gmail.com', "adadadaadaadd", false);
    try {
        $mail_ids = $mailbox->searchMailbox('ALL');
    } catch (ConnectionException $ex) {
       $error = $ex->getMessage();
        echo $error;
    } catch (Exception $ex) {
        $error = $ex->getMessage();
        echo $error;
    }
                
 }catch (ConnectionException $ex) {
        $error = $ex->getMessage();
        echo $error;
        
    }catch (Exception $ex) {
        $error = $ex->getMessage();
        echo $error;
       
}

Its never echo error but instead giving fatal error on invalid password etc, Let me know if I am missing anything in this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs investigationThis will be tested / debugged or checked out.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions