Skip to content

Commit

Permalink
Merge pull request #66 from conekta/fix/error-display
Browse files Browse the repository at this point in the history
Hot fix in order to allow programmer to access error properties.
  • Loading branch information
MauricioMurga authored Feb 2, 2017
2 parents 2b5d3ed + 2bb7295 commit 13e4b9a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/Conekta/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@

class Error extends Exception
{

public function __get($property)
{
if (property_exists($this, $property)) {
return $this->$property;
}
}

public function __isset($property)
{
return isset($this->$property);
}

public static function build($resp, $http_code)
{
$message = isset($resp['message']) ? $resp['message'] : null;
Expand Down

0 comments on commit 13e4b9a

Please sign in to comment.