src/Common/Service/ErrorHandler.php
public static function halt($sError, $sSubject = '', int $iCode = HttpCodes::STATUS_INTERNAL_SERVER_ERROR)
    {
        if (php_sapi_name() === 'cli' || defined('STDIN')) {

            $sSubject = trim(strip_tags($sSubject));
            $sError   = trim(strip_tags($sError));

            echo "\n";
            echo $sSubject ? 'ERROR: ' . $sSubject . ":\n" : '';
            echo $sSubject ? $sError : 'ERROR: ' . $sError;
            echo "\n\n";

        } else {
            set_status_header($iCode);
            ?>
            <style type="text/css">
                p {
                    font-family: monospace;
                    margin: 20px 10px;
                }

                strong {
                    color: red;
                }

                code {
                    padding: 5px;
                    border: 1px solid #CCC;
                    background: #EEE
                }
            </style>
            <p>
                <strong>ERROR:</strong>
                <?=$sSubject ? '<em>' . $sSubject . '</em> - ' : ''?>
                <?=$sError?>
            </p>
            <?php
        }
        exit(1);
    }
public static function halt($sError, $sSubject = '', int $iCode = HttpCodes::STATUS_INTERNAL_SERVER_ERROR)
    {
        if (php_sapi_name() === 'cli' || defined('STDIN')) {

            $sSubject = trim(strip_tags($sSubject));
            $sError   = trim(strip_tags($sError));

            echo "\n";
            echo $sSubject ? 'ERROR: ' . $sSubject . ":\n" : '';
            echo $sSubject ? $sError : 'ERROR: ' . $sError;
            echo "\n\n";

        } else {
            set_status_header($iCode);
            ?>
            <style type="text/css">
                p {
                    font-family: monospace;
                    margin: 20px 10px;
                }

                strong {
                    color: red;
                }

                code {
                    padding: 5px;
                    border: 1px solid #CCC;
                    background: #EEE
                }
            </style>
            <p>
                <strong>ERROR:</strong>
                <?=$sSubject ? '<em>' . $sSubject . '</em> - ' : ''?>
                <?=$sError?>
            </p>
            <?php
        }
        exit(1);
    }
public static function halt ( $ sError , $ sSubject = '' , int $ iCode = HttpCodes :: STATUS_INTERNAL_SERVER_ERROR ) { if ( php_sapi_name ( ) === 'cli' || defined ( 'STDIN' ) ) { $ sSubject = trim ( strip_tags ( $ sSubject ) ) ; $ sError = trim ( strip_tags ( $ sError ) ) ; echo "\n" ; echo $ sSubject ? 'ERROR: ' . $ sSubject . ":\n" : '' ; echo $ sSubject ? $ sError : 'ERROR: ' . $ sError ; echo "\n\n" ; } else { set_status_header ( $ iCode ) ; ?>
            <style type="text/css">
                p {
                    font-family: monospace;
                    margin: 20px 10px;
                }

                strong {
                    color: red;
                }

                code {
                    padding: 5px;
                    border: 1px solid #CCC;
                    background: #EEE
                }
            </style>
            <p>
                <strong>ERROR:</strong>
                <?= $ sSubject ? '<em>' . $ sSubject . '</em> - ' : '' ?>
                <?= $ sError ?>
            </p>
            <?php } exit ( 1 ) ; }
A very low-level error function, used before the main error handling stack kicks in

@param string $sError   The error to show
@param string $sSubject An optional subject line
@param int    $iCode    The status code to send
A very low - level error function used before the main error handling stack kicks in