HFP-3095 Add error message if unable to contact hub
Fix translation Update hub registration uicontent-hub
parent
67bce48842
commit
917a9b6ccb
|
@ -3677,7 +3677,7 @@ class H5PCore {
|
|||
'helpChoosingLicense' => $this->h5pF->t('Help me choose a license'),
|
||||
'shareFailed' => $this->h5pF->t('Share failed.'),
|
||||
'editingFailed' => $this->h5pF->t('Editing failed.'),
|
||||
'shareTryAgain' => $this->h5pF->t('Something went wrong, please try to share agian.'),
|
||||
'shareTryAgain' => $this->h5pF->t('Something went wrong, please try to share again.'),
|
||||
'pleaseWait' => $this->h5pF->t('Please wait...'),
|
||||
'language' => $this->h5pF->t('Language'),
|
||||
'level' => $this->h5pF->t('Level'),
|
||||
|
@ -3774,6 +3774,10 @@ class H5PCore {
|
|||
throw new Exception($this->h5pF->t('Unable to authorize with the H5P Hub. Please check your Hub registration and connection.'));
|
||||
}
|
||||
|
||||
if (isset($response['status']) && $response['status'] !== 200) {
|
||||
throw new Exception($this->h5pF->t('Connecting to the content hub failed, please try again later.'));
|
||||
}
|
||||
|
||||
$result = json_decode($response['data']);
|
||||
if (isset($result->success) && $result->success === TRUE) {
|
||||
return $result;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue