From 6f5a0f978fb5d1c0c85fef4c51eaf9423729c989 Mon Sep 17 00:00:00 2001 From: ajimix Date: Wed, 24 Oct 2018 16:26:01 +0800 Subject: [PATCH] Adds failOnError on the example --- examples/report-errors.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/report-errors.php b/examples/report-errors.php index 5062379..b3d3d54 100644 --- a/examples/report-errors.php +++ b/examples/report-errors.php @@ -4,6 +4,7 @@ // See class comments and Asana API for full info $asana = new Asana(array('personalAccessToken' => 'xxxxxxxxxxxxxxxxxxxxx')); // Create a personal access token in Asana or use OAuth +$asana->failOnError = false; // Disable failing on API return codes >= 400 $taskId = 5555555555; // Something invalid to provoke an error $asana->getTask($taskId); @@ -14,7 +15,7 @@ foreach ($errors as $key => $error) { $key++; echo "Error $key: " . $error->message . '
'; // The error details, such as "task: Not a recognized ID: 5555555555" - echo "Details: " . $error->help . '
'; // Details, which seems to just link to the getting-started/errors documentation + echo 'Details: ' . $error->help . '
'; // Details, which seems to just link to the getting-started/errors documentation } return; }