| @@ 27-34 (lines=8) @@ | ||
| 24 | /** |
|
| 25 | * If not return error code |
|
| 26 | */ |
|
| 27 | public function getErrorCode() |
|
| 28 | { |
|
| 29 | if ($this->isSuccess()) { |
|
| 30 | throw new \BadMethodCallException('Response is correct, no error code available'); |
|
| 31 | } |
|
| 32 | ||
| 33 | return (int)$this->xml->error[0]['code']; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * If not return error message |
|
| @@ 39-46 (lines=8) @@ | ||
| 36 | /** |
|
| 37 | * If not return error message |
|
| 38 | */ |
|
| 39 | public function getErrorMessage() |
|
| 40 | { |
|
| 41 | if ($this->isSuccess()) { |
|
| 42 | throw new \BadMethodCallException('Response is correct, no error message available'); |
|
| 43 | } |
|
| 44 | ||
| 45 | return (string)$this->xml->error[0]['msg']; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Return XML response from Wiziq |
|