diff --git a/src/Request.php b/src/Request.php index 155504d..275f80c 100644 --- a/src/Request.php +++ b/src/Request.php @@ -117,6 +117,16 @@ protected function exec(){ $contents=$e->getResponse()->getBody()->getContents(); $temp=json_decode($contents,true); + + if (preg_match('/overload/i', $temp['error']['message'])) { + $this->auth(); + try { + return json_decode($this->send(),true); + } catch (RequestException $e) { + throw new Exception($temp); + } + } + if(!empty($temp)) { $temp['_method']=$this->type; $temp['_url']=$this->host.$this->path; @@ -133,4 +143,4 @@ protected function exec(){ throw new Exception(json_encode($temp)); } } -} \ No newline at end of file +}