Skip to content

Commit 498aebf

Browse files
authored
Merge pull request #4 from WalentinG/error-description-for-400
Added description to error for http status code 400
2 parents 9e0b2e1 + d4a335a commit 498aebf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Interaction/InteractionsProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ function () use ($method, $credentials): \Generator
134134
);
135135
}
136136

137+
if ($response->getStatausCode() === 400)
138+
{
139+
throw new \RuntimeException(jsonDecode((string) $response->getBody())['description']
140+
?? \sprintf('Method %s has invalid parameters', $method->methodName()));
141+
}
142+
137143
if ($response->getStatusCode() === 404)
138144
{
139145
throw new \RuntimeException(\sprintf('Method %s not exists', $method->methodName()));

0 commit comments

Comments
 (0)