From 831f04d6e48f5d52e86d6cb7b06b235278dc264e Mon Sep 17 00:00:00 2001 From: amirbagh75 Date: Sat, 21 Nov 2020 23:50:01 +0330 Subject: [PATCH] Add try/catch in example --- README.md | 9 +++++++-- examples/index.php | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e847926..57ed43c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ composer require amirbagh75/smsir-php ```php smsCredit()); +try { + $res = $smsir->getSentMessages('1399/06/01', '1399/10/01', 1, 250); + print_r($res); +} catch (\GuzzleHttp\Exception\GuzzleException $e) { + error_log($e->getMessage(), 0); +} ``` ### Current methods: diff --git a/examples/index.php b/examples/index.php index 23e0430..6eb58cb 100644 --- a/examples/index.php +++ b/examples/index.php @@ -9,6 +9,10 @@ $lineNumber = getenv('LINE_NUMBER'); $smsir = new SmsIRClient($apiKey, $secretKey, $lineNumber); -$res = $smsir->getSMSLines(); +try { + $res = $smsir->getSentMessages('1399/06/01', '1399/10/01', 1, 250); + print_r($res); +} catch (\GuzzleHttp\Exception\GuzzleException $e) { + error_log($e->getMessage(), 0); +} -print_r($res->isSuccessful);