Skip to content

Commit

Permalink
update example.php with namespace changes: HipChat\HipChat_Exception
Browse files Browse the repository at this point in the history
The new version catches exceptions correctly.
The old version could result in "Fatal error: Uncaught exception 'HipChat\HipChat_Exception'".
You can verify this by using a Notification token (which has insufficient privileges), instead of an Admin token.
  • Loading branch information
dxjones committed Sep 7, 2013
1 parent eed7670 commit 7d65cdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$room_data = $hc->get_room($room->room_id);
echo " - Participants: ".count($room_data->participants)."\n";
}
} catch (HipChat_Exception $e) {
} catch (HipChat\HipChat_Exception $e) {
echo "Oops! Error: ".$e->getMessage();
}

Expand All @@ -39,6 +39,6 @@
$user_data = $hc->get_user($user->user_id);
echo " - Status: ".$user_data->status."\n";
}
} catch (HipChat_Exception $e) {
} catch (HipChat\HipChat_Exception $e) {
echo "Oops! Error: ".$e->getMessage();
}

0 comments on commit 7d65cdb

Please sign in to comment.