Skip to content

Exception handling #28

Open
Open
@sami616

Description

@sami616

Hi, I'm having some difficulty understanding how exception handling would work. I'm having some trouble catching the below Exception for example. I'm thinking i'm perhaps in the wrong namespace and/or trying to catch the wrong Exception?

namespace DotMailer\Api\DataTypes;

$contact = new ApiContact();
$contact->email = $_POST['email'];
$contact->emailtype = $_POST['email_type'];


try {
	$contact = $resources->PostContacts('invalid input');
} catch (Exception $e) {
	echo $e->getMessage();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions