diff --git a/sources/LongreadError.php b/sources/LongreadError.php index f3edf63..28bfd5c 100644 --- a/sources/LongreadError.php +++ b/sources/LongreadError.php @@ -6,7 +6,7 @@ class LongreadError { public string $status = 'ERROR'; - public string $result = ''; + public $result; public bool $error = true; @@ -22,10 +22,12 @@ class LongreadError */ public string $url; - public function __construct($error_message = '', $error_code = 0, $url = '') + public function __construct($error_message = '', $error_code = 0, $url = '', $id = 0) { $this->error_message = $error_message; $this->error_code = $error_code; $this->url = $url; + $this->result = new \stdClass(); + $this->result->id = $id; } } \ No newline at end of file diff --git a/sources/Longreads.php b/sources/Longreads.php index 33e1e0a..a1bbf2f 100644 --- a/sources/Longreads.php +++ b/sources/Longreads.php @@ -685,8 +685,11 @@ public function getPageFullExport($id, $associative = null) return $associative ? [ 'status' => 'ERROR', 'message' => $e->getMessage(), + 'result' => [ + 'id' => $id + ], 'errorside' => 'info' - ] : new LongreadError($e->getMessage(), $curl->error_code, $url); + ] : new LongreadError($e->getMessage(), $curl->error_code, $url, $id); } }