]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/commitdiff
Return errors from the ircd
authorDenver F <redacted>
Sun, 10 Jul 2022 01:02:58 +0000 (02:02 +0100)
committerDenver F <redacted>
Sun, 10 Jul 2022 01:02:58 +0000 (02:02 +0100)
lib/Connection.php

index bbe400828d9ed624144079afcbc41e38b0d28560..ed927e0b48c4b1678e20df77665d1e44217cf4a5 100644 (file)
@@ -56,14 +56,17 @@ class Connection
 
         $reply = json_decode($reply);
 
-        if ($reply->response) {
+        if (property_exists($reply, 'response')) {
             if($id !== $reply->id) {
                 throw new Exception('Invalid ID. This is not the expected reply.');
             }
-
             return $reply->response;
-        } else {
-            return false;
         }
+
+        if(property_exists($reply, 'error')) {
+            return $reply->error;
+        }
+
+        return false;
     }
 }