Permalink
Browse files

added getErrors function

  • Loading branch information...
1 parent fb32aa2 commit c9742f7f66070b862b42e4bd2f043618888135b8 @thinkerytim thinkerytim committed Mar 6, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Core.php
View
@@ -218,6 +218,10 @@ function return_first_result($response) {
*/
function MakeAPICall($method, $service, $cache_time = 0, $params = array(), $post_data = null, $a_retry = false) {
+
+ // reset last error code
+ $this->last_error_code = false;
+ $this->last_error_mess = false;
if ($this->transport == null) {
$this->SetTransport(new flexmlsAPI_CurlTransport);
@@ -652,6 +656,17 @@ function GetCustomFields($prop_type) {
function GetSystemInfo() {
return $this->return_first_result($this->MakeAPICall("GET", "system", '24h'));
}
+
+ /*
+ * Error services
+ */
+ function GetErrors() {
+ if ($this->last_error_code || $this->last_error_mess){
+ return $this->last_error_code.' - '.$this->last_error_mess;
+ } else {
+ return false;
+ }
+ }
}

0 comments on commit c9742f7

Please sign in to comment.