Conditions | 4 |
Paths | 3 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Crunch\Salesforce\Exceptions; |
||
20 | public function __construct($message, $requestBody) |
||
21 | { |
||
22 | $this->requestBody = $requestBody; |
||
23 | $error = json_decode($requestBody, true); |
||
24 | |||
25 | //Errors generated during the auth stage are different to those generated during normal requests |
||
26 | if (isset($error['error']) && isset($error['error_description'])) { |
||
27 | |||
28 | $this->errorCode = $error['error']; |
||
29 | parent::__construct($error['error_description']); |
||
30 | |||
31 | } else if (isset($error[0]['message'])) { |
||
32 | |||
33 | $this->errorCode = $error[0]['errorCode']; |
||
34 | parent::__construct($error[0]['message']); |
||
35 | |||
36 | } else { |
||
37 | |||
38 | $this->errorCode = $error['errorCode']; |
||
39 | parent::__construct($error['message']); |
||
40 | |||
41 | } |
||
42 | } |
||
43 | |||
60 | } |