Skip to content

Commit

Permalink
Set proper HTTP response code on error (#1499)
Browse files Browse the repository at this point in the history
I was doing some AJAX work in DEV mode and discovered that Magento returns a status 200 for uncaught exceptions. This single line fixes it.
  • Loading branch information
woutersamaey authored May 12, 2021
1 parent 4bfd347 commit 7914f77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ public static function getIsDeveloperMode()
public static function printException(Throwable $e, $extra = '')
{
if (self::$_isDeveloperMode) {
@http_response_code(500);
print '<pre>';

if (!empty($extra)) {
Expand Down

0 comments on commit 7914f77

Please # to comment.