Skip to content

Commit 2eacdb9

Browse files
committed
updates exception example with namespacing
1 parent b601ab0 commit 2eacdb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/errors_exception_direct.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use alsvanzelf\jsonapi;
4+
35
ini_set('display_errors', 1);
46
error_reporting(-1);
57

@@ -15,10 +17,10 @@
1517
*/
1618

1719
try {
18-
$http_status = \alsvanzelf\jsonapi\response::STATUS_NOT_FOUND;
20+
$http_status = jsonapi\response::STATUS_NOT_FOUND;
1921
$friendly_message = 'We don\'t know this user.';
2022
$about_link = 'www.example.com/search';
21-
throw new \alsvanzelf\jsonapi\exception('unknown user', $http_status, $previous=null, $friendly_message, $about_link);
23+
throw new jsonapi\exception('unknown user', $http_status, $previous=null, $friendly_message, $about_link);
2224
}
2325
catch (Exception $e) {
2426
echo $e;

0 commit comments

Comments
 (0)