Skip to content

Commit

Permalink
Reduced redundant code.
Browse files Browse the repository at this point in the history
php.net\Exception has an exception code.
TaxJar\Exception adds an exception code, blocking usage of the php's exception code, and php's previous.
  • Loading branch information
rrehbein committed Nov 30, 2018
1 parent f03b58e commit 9522e24
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@

class Exception extends \Exception
{
protected $status_code;

public function __construct($message, $status_code = 0)
{
$this->status_code = $status_code;
parent::__construct($message);
}

/**
* Alias to getCode, for backwards compatibility
*/
final public function getStatusCode()
{
return $this->status_code;
return $this->getCode();
}
}

0 comments on commit 9522e24

Please sign in to comment.