Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
0.1.6 better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bossanova808 committed Jun 7, 2017
1 parent 1fe2629 commit c0003dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion commerceauspostlookup/CommerceAusPostLookupPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class CommerceAusPostLookupPlugin extends BasePlugin
{

private $version = "0.1.5";
private $version = "0.1.6";
private $schemaVersion = "0.0.0";

private $name = 'Commerce Aus Post Lookup';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function actionLookup()
$pcJSON = json_decode($rawBody);
}
catch (Exception $e) {
CommerceAusPostLookupPlugin::logError("Caught Exception in JSON decode: " . $e->getMessage());
$errors[] = "Caught Exception in JSON decode: " . $e->getMessage();
}

Expand All @@ -61,7 +62,7 @@ public function actionLookup()
"NSW" => "New South Wales",
"QLD" => "Queensland",
"TAS" => "Tasmania",
"ACT" => "Australian Captial Territory",
"ACT" => "Australian Capital Territory",
);

$statesIDMap = array(
Expand Down Expand Up @@ -101,6 +102,10 @@ public function actionLookup()
}
}
}
else{
CommerceAusPostLookupPlugin::logError("pcJSON is not an object....");
$errors[] = "Invalid data returned from Australia Post - please try again in a new minutes";
}

if($errors){
$allErrors = "";
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
// $time = new DateTime; echo $time->format(DateTime::ATOM);

[
{
"version": "0.1.6",
"date": "2017-06-07T09:35:28+10:00",
"downloadUrl": "https://github.com/bossanova808/CommerceAusPostLookup/archive/0.1.6.zip",
"notes": [
"[Fixed] Better error logging again",
]
},
{
"version": "0.1.5",
"date": "2016-09-07T09:35:28+10:00",
Expand Down

0 comments on commit c0003dc

Please sign in to comment.