Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More catching of exceptions

  • Loading branch information...
commit 7f8e7b9df911d4ab859871439b18b1028f8669dd 1 parent 686b382
@haugstrup authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 index.php
View
16 index.php
@@ -18,11 +18,17 @@ function scrumboard() {
// Grab sprints and find current sprint
// $filters = array(array('key' => SPRINT_STATE_ID, 'values' => array('Active')));
- $sprints = $api->item->getItems(SPRINT_APP_ID, array(
- 'limit' => 5,
- 'sort_by' => 'created_on',
- 'sort_desc' => 1
- ));
+ try {
+ $sprints = $api->item->getItems(SPRINT_APP_ID, array(
+ 'limit' => 5,
+ 'sort_by' => 'created_on',
+ 'sort_desc' => 1
+ ));
+ }
+ catch (PodioError $e) {
+ die("There was an error. The API responded with the error type <b>{$e->body['error']}</b> and the message <b>{$e->body['error_description']}</b>. The URL was <b>{$e->url}</b><br><a href='".url_for('logout')."'>Log out</a>");
+ }
+
foreach ($sprints['items'] as $item) {
if (params('id') == $item['item_id']) {
$current_sprint = $item;
Please sign in to comment.
Something went wrong with that request. Please try again.