Skip to content

Commit

Permalink
Store error message in $message
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
barryvdh authored Jul 12, 2017
1 parent 8f7c0b8 commit 985a1ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Message/AbstractResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ abstract class AbstractResponse extends BaseAbstractResponse
* @var string
*/
protected $code;

/**
* @var string
*/
protected $message;

/**
* {@inheritdoc}
Expand All @@ -22,7 +27,7 @@ public function __construct(RequestInterface $request, $data)

if (isset($this->data->error)) {
$this->code = (string) $this->data->error->errorcode;
$this->data = (string) $this->data->error->errormessage;
$this->message = (string) $this->data->error->errormessage;
}
}

Expand All @@ -32,7 +37,7 @@ public function __construct(RequestInterface $request, $data)
public function getMessage()
{
if (!$this->isSuccessful()) {
return $this->data;
return $this->message;
}

return null;
Expand Down

0 comments on commit 985a1ad

Please sign in to comment.