diff --git a/src/simply-rets-api-helper.php b/src/simply-rets-api-helper.php
index 2157fa4..c48ff2c 100644
--- a/src/simply-rets-api-helper.php
+++ b/src/simply-rets-api-helper.php
@@ -581,9 +581,13 @@ public static function srResidentialDetailsGenerator( $listing ) {
* The error code comes from the UrlBuilder function.
*/
if($listing == NULL
+ || property_exists($listing, "message")
|| property_exists($listing, "error")
|| property_exists($listing, "errors")) {
- $err = SrMessages::noResultsMsg((array)$listing);
+ $err = SrMessages::noResultsMsg(
+ (array)$listing,
+ "Details for this listing are no longer available."
+ );
return $err;
}
diff --git a/src/simply-rets-utils.php b/src/simply-rets-utils.php
index 1e45672..3333d6b 100644
--- a/src/simply-rets-utils.php
+++ b/src/simply-rets-utils.php
@@ -530,14 +530,13 @@ public static function getBathroomsDisplay(
class SrMessages {
- public static function noResultsMsg($response) {
+ public static function noResultsMsg($response, $msg) {
$response = (array)$response;
+ $message = $msg ? $msg : $response['message'];
if(array_key_exists("message", $response)) {
return (
- '
' - . $response['message'] - . '
' + '' . $message . '
' ); }