Skip to content

Commit

Permalink
1.0.101
Browse files Browse the repository at this point in the history
* [+] Pre Curl Release
* [*] fix LongreadError()
* [*] more return info
  • Loading branch information
KarelWintersky committed Aug 9, 2022
1 parent f184be0 commit 1f7a0c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions sources/LongreadError.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class LongreadError
{
public string $status = 'ERROR';

public string $result = '';
public $result;

public bool $error = true;

Expand All @@ -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;
}
}
5 changes: 4 additions & 1 deletion sources/Longreads.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 1f7a0c0

Please sign in to comment.