Page MenuHomePhabricator

MediaWiki\Rest\HttpException should support 3xx codes and wrapped Responses
Closed, ResolvedPublic

Description

Often an exceptional condition is not a 4xx error code, it might be a redirect or require custom headers or content.

Event Timeline

cscott renamed this task from MediaWiki\Rest\HttpError should support 3xx codes and wrapped Responses to MediaWiki\Rest\HttpException should support 3xx codes and wrapped Responses.Aug 20 2020, 11:49 PM

See https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/621558 for the use case, where a redirect (with custom headers) is the exceptional condition caused by a failure to extract a page id.

Change 621615 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] MediaWiki\Rest\HttpException: Support 3xx codes and wrapped Response

https://gerrit.wikimedia.org/r/621615

I'm a bit dubious about the idea. While I can see that this would be useful in some cases, it should not be the rule to use exceptions to generate non-error response. it seems to me like in most cases, this would obscure the information flow.

Change 626725 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/services/parsoid@master] Rest: Use upstreamed ResponseException

https://gerrit.wikimedia.org/r/626725

Change 621615 merged by jenkins-bot:
[mediawiki/core@master] MediaWiki\Rest\HttpException: Support 3xx codes and wrapped Response

https://gerrit.wikimedia.org/r/621615

Change 626725 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Rest: Use upstreamed ResponseException

https://gerrit.wikimedia.org/r/626725

Change 628157 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/services/parsoid@master] Rest: Use upstreamed ResponseException

https://gerrit.wikimedia.org/r/628157

Change 628944 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a10

https://gerrit.wikimedia.org/r/628944

Change 628157 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Rest: Use upstreamed ResponseException

https://gerrit.wikimedia.org/r/628157

Change 635100 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a12

https://gerrit.wikimedia.org/r/635100

Change 635100 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a12

https://gerrit.wikimedia.org/r/635100

Pppery subscribed.

All patches are merged. Can this be closed as resolved?

No response, closing.