Throw exception on session initialization error
This commit is contained in:
parent
8cff7f8a6f
commit
a6a4e20ca0
|
@ -29,12 +29,12 @@ class FileSystemListing extends Service {
|
|||
'removeHidden' => $removeHidden,
|
||||
]);
|
||||
|
||||
$FsTask_xs = $rest->getCurlResponse()['result'];
|
||||
$FsTasks = [];
|
||||
foreach( $FsTask_xs as $fsTask_x) {
|
||||
$FsTasks[] = new FileInfo( $fsTask_x);
|
||||
$FileInfo_xs = $rest->getCurlResponse()['result'];
|
||||
$FileInfos = [];
|
||||
foreach( $FileInfo_xs as $FileInfo_x) {
|
||||
$FileInfos[] = new FileInfo( $FileInfo_x);
|
||||
}
|
||||
return $FsTasks;
|
||||
return $FileInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,6 +48,9 @@ class Session extends Service {
|
|||
'password' => hash_hmac( 'sha1', $this->challenge, $this->application->getAppToken()),
|
||||
]);
|
||||
|
||||
if( ! $rest->getCurlResponse()['success']){
|
||||
throw new \Exception( $rest->getCurlResponse()['error_code'] .' : '. $rest->getCurlResponse()['msg']);
|
||||
}
|
||||
$this->session_token = $rest->getCurlResponse()['result']['session_token'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue