Skip to content

Commit f2b2b88

Browse files
committed
Fix exception parameter, update README
1 parent 3d20020 commit f2b2b88

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Objects like Post or Collection will update automagically after calling a save/g
4545

4646
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.
4747

48-
# Work in progress
48+
All errors are transformed to WAException objects, which are catchable.
49+
50+
# Supports the following api endpoints (near) completely
4951

5052
- [x] Authentication
5153
- [x] Posts

lib/Context.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public function request( string $url, ?string $postdata = null, ?string $customR
6969

7070
if ( (int) $statusCode >= 400 ) {
7171
throw new WAException( null, $statusCode );
72-
73-
return null;
7472
}
7573

7674
if ( $output !== false && !empty( $output ) ) {

lib/WAException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class WAException extends \Exception
1818
503 => "Server Error"
1919
);
2020

21-
function __construct( $message = null, $code = 0, Exception $previous = null )
21+
function __construct( $message = null, $code = 0, \Exception $previous = null )
2222
{
2323
if ( isset( $this->exceptions[ $code ] ) ) {
2424
$message = $this->exceptions[ $code ];

0 commit comments

Comments
 (0)