Skip to content

Commit 7914f77

Browse files
authored
Set proper HTTP response code on error (#1499)
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.
1 parent 4bfd347 commit 7914f77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/Mage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ public static function getIsDeveloperMode()
969969
public static function printException(Throwable $e, $extra = '')
970970
{
971971
if (self::$_isDeveloperMode) {
972+
@http_response_code(500);
972973
print '<pre>';
973974

974975
if (!empty($extra)) {

0 commit comments

Comments
 (0)