APIv4 - Fix HTTP status code selection
authorTim Otten <totten@civicrm.org>
Thu, 4 Feb 2021 21:15:17 +0000 (13:15 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 4 Feb 2021 21:15:17 +0000 (13:15 -0800)
commitb8ccbe7392f76e542e5f2c30d8d46f485ba949e3
tree22a56a587a588d1611083ec2e35c8653af0d92b1
parent69bb8c7f553de544d2adc74d42a4fb72f7de6bd6
APIv4 - Fix HTTP status code selection

This is a follow-up to #19526 which addresses a typo that causes a misbehavior in reporting the HTTP status code.

Before
------

If an API request encounters an exception, then it always returns HTTP 403.

After
-----

If an API request encounters an exception, then:

* It may return HTTP 403 (for an authorization exception)
* It may return HTTP 500 (for any other/unrecognized exception)
CRM/Api4/Page/AJAX.php