mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-31 01:11:25 +00:00
actually display prefinery error to users
This commit is contained in:
parent
07279fc7d0
commit
9a3ad01dc9
1 changed files with 12 additions and 2 deletions
|
@ -172,9 +172,19 @@ class DownloadActions extends Actions
|
|||
|
||||
$data = json_decode($body, true);
|
||||
|
||||
if (!$data || !isset($data['share_link']))
|
||||
if (!$data)
|
||||
{
|
||||
throw new PrefinerySubscribeException('Missing share_link.');
|
||||
throw new PrefinerySubscribeException('Received empty response.');
|
||||
}
|
||||
else if (isset($data['errors']))
|
||||
{
|
||||
throw new PrefinerySubscribeException(implode("\n", array_map(function($error) {
|
||||
return $error['message'];
|
||||
}, (array)$data['errors'])));
|
||||
}
|
||||
else if (!isset($data['share_link']))
|
||||
{
|
||||
throw new PrefinerySubscribeException('Missing share_link');
|
||||
}
|
||||
|
||||
$shareLink = $data['share_link'];
|
||||
|
|
Loading…
Add table
Reference in a new issue