-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add response id to request error. (bunq/sdk_php#88) #93
Merged
andrederoos
merged 18 commits into
develop
from
feature/bunq/sdk_php#88-add_response_id_to_request_error
Jan 2, 2018
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c77832d
Added response id header constants. (bunq/sdk_php#88)
OGKevin 1b3aaa5
Added new responseId field to base exception class. (bunq/sdk_php#88)
OGKevin 1bd4279
Altered generateErrorMessage to also include the response id in the e…
OGKevin d1ff10b
Pass the response id to the exceptions in ExceptionFactory. (bunq/sdk…
OGKevin 872c4a0
Added missing spaces for better method formatting. (bunq/sdk_php#88)
OGKevin e201559
Added error constant in case response header retrieval fails. (bunq/s…
OGKevin 33b8e35
Added method to get the response id from the failed request response.…
OGKevin 1a182a6
Added test to make sure that the response header can be retrieved fro…
OGKevin ad04c24
Optimised imports. (bunq/sdk_php#88)
OGKevin c3c5089
Removed plural variables. (bunq/sdk_php#88)
OGKevin f7178b7
Changed constant name of GLUE_ERROR_MESSAGES to SEPARATOR_ERROR_MESSA…
OGKevin 041550b
Removed unneeded empty new line. (bunq/sdk_php#88)
OGKevin cd65652
Extracted magic value. (bunq/sdk_php#88)
OGKevin f96b6b6
Fixed typo in caughtExcretion to caughtException. (bunq/sdk_php#88)
OGKevin 1f8fbf3
Removed plural from glueMessages. (bunq/sdk_php#88)
OGKevin c9a2379
Removed plural parameter from glueAllMessage. (bunq/sdk_php#88)
OGKevin 3653cf3
Reanmed response header constants to the propper name. (bunq/sdk_php#88)
OGKevin f040d04
Merge branch 'develop' into feature/bunq/sdk_php#88-add_response_id_t…
andrederoos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace bunq\test\Http; | ||
|
||
use bunq\Exception\BadRequestException; | ||
use bunq\Model\Generated\Endpoint\UserPerson; | ||
use bunq\test\BunqSdkTestBase; | ||
|
||
/** | ||
* Tests if the response id from a failed request can be retrieved successfully. | ||
*/ | ||
class ErrorResponseIdTest extends BunqSdkTestBase | ||
{ | ||
/** | ||
* Invalid user id to trigger BadRequestException | ||
*/ | ||
const INVALID_USER_PERSON_ID = 0; | ||
|
||
/** | ||
*/ | ||
public function testBadRequestWitResponseId() | ||
{ | ||
$caughtException = null; | ||
|
||
try { | ||
UserPerson::get(static::$apiContext, self::INVALID_USER_PERSON_ID); | ||
} catch (BadRequestException $exception) { | ||
$caughtException = $exception; | ||
} | ||
|
||
static::assertNotNull($caughtException); | ||
static::assertNotNull($caughtException->getResponseId()); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid, as you can see this particular line has not been changed in this pr and therefore only a snippet of the doc block is show. If you look at the original file you see that this doc block is correct 🙃 see:
sdk_php/src/Http/Handler/ResponseHandlerError.php
Line 41 in 1a5188b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, missed that one. Ignore then. 😄