Skip to content

Commit 985a1ad

Browse files
authored
Store error message in $message
Fixes #6
1 parent 8f7c0b8 commit 985a1ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Message/AbstractResponse.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ abstract class AbstractResponse extends BaseAbstractResponse
1212
* @var string
1313
*/
1414
protected $code;
15+
16+
/**
17+
* @var string
18+
*/
19+
protected $message;
1520

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

2328
if (isset($this->data->error)) {
2429
$this->code = (string) $this->data->error->errorcode;
25-
$this->data = (string) $this->data->error->errormessage;
30+
$this->message = (string) $this->data->error->errormessage;
2631
}
2732
}
2833

@@ -32,7 +37,7 @@ public function __construct(RequestInterface $request, $data)
3237
public function getMessage()
3338
{
3439
if (!$this->isSuccessful()) {
35-
return $this->data;
40+
return $this->message;
3641
}
3742

3843
return null;

0 commit comments

Comments
 (0)