Skip to content

Commit

Permalink
Fix exception parameter, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
martijndeb committed Jun 1, 2020
1 parent 3d20020 commit f2b2b88
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ Objects like Post or Collection will update automagically after calling a save/g

Authentication is done on the Context. If you want to authenticate multiple users for some reason, use multiple contexts. Upon logging in you should store the access token for future sessions. Logout when you need to, don't keep tokens layout around.

# Work in progress
All errors are transformed to WAException objects, which are catchable.

# Supports the following api endpoints (near) completely

- [x] Authentication
- [x] Posts
Expand Down
2 changes: 0 additions & 2 deletions lib/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public function request( string $url, ?string $postdata = null, ?string $customR

if ( (int) $statusCode >= 400 ) {
throw new WAException( null, $statusCode );

return null;
}

if ( $output !== false && !empty( $output ) ) {
Expand Down
2 changes: 1 addition & 1 deletion lib/WAException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class WAException extends \Exception
503 => "Server Error"
);

function __construct( $message = null, $code = 0, Exception $previous = null )
function __construct( $message = null, $code = 0, \Exception $previous = null )
{
if ( isset( $this->exceptions[ $code ] ) ) {
$message = $this->exceptions[ $code ];
Expand Down

0 comments on commit f2b2b88

Please sign in to comment.