Skip to content
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

Ensure HTTP exception is thrown when API fails #1310

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

MKodde
Copy link
Member

@MKodde MKodde commented Aug 21, 2024

When the pushConnectionsAction fails because the DoctrineMetadataPushRepository failed to save the assembled roles data. We should throw a HTTP exception. Otherwise the action would not output JSON. Resulting in a user facing error page. Which is not user friendly for a consumer

Fixes: #1309

When the pushConnectionsAction fails because the DoctrineMetadataPushRepository
failed to save the assembled roles data. We should throw a HTTP
exception. Otherwise the action would not output JSON. Resulting in a
user facing error page. Which is not user friendly for a consumer

Fixes: #1309
@MKodde MKodde requested review from baszoetekouw and thijskh August 21, 2024 13:21
@@ -54,7 +54,7 @@ public function authentication_is_required_for_pushing_metadata()
*/
public function only_post_requests_are_allowed_when_pushing_metadata($invalidHttpMethod)
{
$client = $client = static::createClient([], [
$client = static::createClient([], [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems quite correct, but I'm curious why the strange construction with the double assignment was there in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that was a find and replace mess-up. Of course PHP is perfectly happy to do this. 🙄

@MKodde MKodde merged commit d078128 into main Aug 26, 2024
2 checks passed
@MKodde MKodde deleted the bugfix/connection-push-error branch August 26, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata push returns 302 redirect on error instead of 400/500
2 participants