**********************************************************************
Error Diagnoses
*********************************************************************
493216
public ClassFinder.BadClassFile badClassFile(String key, Object... args) {
        return new ClassFinder.BadClassFile (
            currentOwner.enclClass(),
            currentClassFile,
            diagFactory.fragment(key, args),
            diagFactory);
    }
1078409
protected function errorsHandle()
    {
        $debug = $this->config('debug');

        error_reporting(($debug) ? E_ALL : E_ERROR & ~E_NOTICE);

        set_error_handler(function ($type, $message, $file, $line) {
            throw new \ErrorException($message, 0, $type, $file, $line);
        });

        set_exception_handler(function (\Exception $e) {

            $exception = new ExceptionsMiddleware;

            $log = $this->getLog(); // Force Slim to append log to env if not already
            $env = $this->environment();
            $env['slim.log'] = $log;
            $env['slim.log']->error($e);

            $this->contentType('text/html');
            $this->response()->status(500);

            echo $this->response()->body($exception->renderBody($env, $e));
        });

        register_shutdown_function(function () {

            if ( !is_null($options = error_get_last()) )
            {
                $title = 'Slimore Application Error Shutdown';

                $html  = html($title, [
                    '<meta http-equiv="X-UA-Compatible" content="IE=edge" />',
                    '<meta name="renderer" content="webkit" />',
                    '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />',
                    style([
                        '*{margin:0;padding:0;}',
                        'html {font-size: 62.5%;}',
                        'html, body {max-width: 100%;width: 100%;}',
                        'body {font-size: 1.4rem;font-family: "Microsoft Yahei", Helvetica, Tahoma, STXihei, arial,verdana,sans-serif;background:#fff;color:#555;}',
                        'img {border: none;}',
                        'pre, pre code {font-family:Consolas, arial,verdana,sans-serif;}',
                        '#layout {padding: 6rem;}',
                        '#main {margin: 0 auto;line-height: 1.5;}',
                        '#main > h1 {font-size: 10rem;margin-bottom: 1rem;}',
                        '#main > h3 {margin-bottom: 2rem; font-size: 1.8rem;}',
                        '#main > h4 {margin-bottom: 1rem; font-size: 1.8rem;}',
                        '#main pre {margin: 1.5rem 0;white-space: pre-wrap;word-wrap: break-word;}',
                        '#main > p {white-space: pre-wrap;word-wrap: break-word;line-height: 1.3;margin-bottom: 0.6rem;}',
                        '#main > p > strong {width: 7rem;display:inline-block;}',
                        '.logo {text-align: left;border-top:1px solid #eee;margin-top: 5rem;padding: 3rem 0 0;color: #ccc;}',
                        '.logo > h1 {font-weight: normal;font-size: 5rem;}',
                        '.logo img {margin-left: -2rem;}',
                        '.trace-line {padding: 0.3rem 0.6rem;margin-left:-0.6rem;-webkit-transition: background-color 300ms ease-out;transition: background-color 300ms ease-out;}',
                        '.trace-line:hover {background:#fffccc;}'
                    ])
                ], [
                    '<div id="layout">',
                    '<div id="main">',
                    '<h1>:(</h1>',
                    '<h3>' . $title . '</h3>',
                    '<h4>Details ：</h4>',
                    '<p><strong>Type: </strong> ' . $options['type'] . '</p>',
                    '<p><strong>Message: </strong> ' . $options['message'] . '</p>',
                    '<p><strong>File: </strong> ' . $options['file'] . '</p>',
                    '<p><strong>Line: </strong> ' . $options['line'] . '</p>',
                    '<div class="logo">',
                    '<h1>Slimore</h1>',
                    '<p>The fully (H)MVC framework, based on the Slim PHP Framwork.</p>',
                    '</div>',
                    '</div>',
                    '</div>'
                ]);

                echo $html;

                exit;
            }

        });
    }
1181557
function Error() {
  Illuminati.apply(this, arguments);

  var backtrace = new Backtrace({ error: this })
    , sourcemap = stackmap(Error.sourcemap).map(backtrace.traces);

  this.stringify(backtrace.traces, sourcemap);
}
535310
@Override
	protected void validateComponent(final List<Diagnostic> diags) {
		if (isValidNumber()) {
			super.validateComponent(diags);
			validateNumber(diags);
		} else {
			diags.add(createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_INVALID, this));
		}
	}
997456
private function errors()
    {
        if (env('DEV_MODE')) {
            $whoops = new \Whoops\Run();
            $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
            $whoops->register();
        }
    }
819459
private static function CheckConditions(){
            $oThis = self::CreateInstanceIfNotExists();
            $oThis->sBuffer = str_replace("{else}", "<?php } else { ?>", $oThis->sBuffer);
            $oThis->sBuffer = str_replace("{endif}", "<?php } ?>", $oThis->sBuffer);
            $oThis->sBuffer = str_replace(array('{if }', '{if  }'), "<?php if(false){ ?>", $oThis->sBuffer);

            //IF
            $Offset = 0;

            while(preg_match('/{if\s*(.*?)}/i', $oThis->sBuffer, $aMatches, PREG_OFFSET_CAPTURE, $Offset)){
                $oThis->sBuffer = str_replace($aMatches[0][0], "<?php if(".$aMatches[1][0]."){ ?>", $oThis->sBuffer);
                $Offset = $aMatches[0][1]+strlen($aMatches[0][0]);
            }

            //Elseif
            $Offset = 0;

            while(preg_match('/{elseif\s*(.*?)}/i', $oThis->sBuffer, $aMatches, PREG_OFFSET_CAPTURE, $Offset)){
                $oThis->sBuffer = str_replace($aMatches[0][0], "<?php } elseif(".$aMatches[1][0]."){ ?>", $oThis->sBuffer);
                $Offset = $aMatches[0][1]+strlen($aMatches[0][0]);
            }
        }
1202756
public function errorAction()
    {
        if ($this->arguments->getValidationResults()->hasErrors()) {
            $errors = [];
            foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyName => $propertyErrors) {
                foreach ($propertyErrors as $propertyError) {
                    /** @var \Neos\Error\Messages\Error $propertyError */
                    $error = [
                        'severity' => $propertyError->getSeverity(),
                        'message' => $propertyError->render()
                    ];
                    if ($propertyError->getCode()) {
                        $error['code'] = $propertyError->getCode();
                    }
                    if ($propertyError->getTitle()) {
                        $error['title'] = $propertyError->getTitle();
                    }
                    $errors[$propertyName][] = $error;
                }
            }
            $this->throwStatus(409, null, json_encode($errors));
        }
        $this->throwStatus(400);
    }
75133
function error(err, req, res, next) {
  // log it
  if (!test) console.error(err.stack);

  // respond with 500 "Internal Server Error".
  res.status(500);
  res.send('Internal Server Error');
}
1146893
function diagnostics() {
		$testOutput = array ();

		/* ENTRUST CERTIFICATE DEPRECATED
		if ($this->config ['application_type'] == 'Partner') {
			if (! file_get_contents ( $this->config ['curl_ssl_cert'] )) {
				$testOutput ['ssl_cert_error'] = "Can't read the Xero Entrust cert. You need one for partner API applications. http://developer.xero.com/documentation/getting-started/partner-applications/ \n";
			} else {
				$data = openssl_x509_parse ( file_get_contents ( $this->config ['curl_ssl_cert'] ) );
				$validFrom = date ( 'Y-m-d H:i:s', $data ['validFrom_time_t'] );
				if (time () < $data ['validFrom_time_t']) {
					$testOutput ['ssl_cert_error'] = "Xero Entrust cert not yet valid - cert valid from " . $validFrom . "\n";
				}
				$validTo = date ( 'Y-m-d H:i:s', $data ['validTo_time_t'] );
				if (time () > $data ['validTo_time_t']) {
					$testOutput ['ssl_cert_error'] = "Xero Entrust cert expired - cert valid to " . $validFrom . "\n";
				}
			}
		}
		*/
		
		if ($this->config ['application_type'] == 'Partner' || $this->config ['application_type'] == 'Private') {
			
			if (! file_exists ( $this->config ['rsa_public_key'] ))
				$testOutput ['rsa_cert_error'] = "Can't read the self-signed SSL cert. Private and Partner API applications require a self-signed X509 cert http://developer.xero.com/documentation/advanced-docs/public-private-keypair/ \n";
			if (file_exists ( $this->config ['rsa_public_key'] )) {
				$data = openssl_x509_parse ( file_get_contents ( $this->config ['rsa_public_key'] ) );
				$validFrom = date ( 'Y-m-d H:i:s', $data ['validFrom_time_t'] );
				if (time () < $data ['validFrom_time_t']) {
					$testOutput ['ssl_cert_error'] = "Application cert not yet valid - cert valid from " . $validFrom . "\n";
				}
				$validTo = date ( 'Y-m-d H:i:s', $data ['validTo_time_t'] );
				if (time () > $data ['validTo_time_t']) {
					$testOutput ['ssl_cert_error'] = "Application cert cert expired - cert valid to " . $validFrom . "\n";
				}
			}
			if (! file_exists ( $this->config ['rsa_private_key'] ))
				$testOutput ['rsa_cert_error'] = "Can't read the self-signed cert key. Check your rsa_private_key config variable. Private and Partner API applications require a self-signed X509 cert http://developer.xero.com/documentation/advanced-docs/public-private-keypair/ \n";
			if (file_exists ( $this->config ['rsa_private_key'] )) {
				$cert_content = file_get_contents ( $this->config ['rsa_public_key'] );
				$priv_key_content = file_get_contents ( $this->config ['rsa_private_key'] );
				if (! openssl_x509_check_private_key ( $cert_content, $priv_key_content ))
					$testOutput ['rsa_cert_error'] = "Application certificate and key do not match \n";
				;
			}
		}
		
		return $testOutput;
	}
935573
function diagnoseIt(error, diagnose) {
    // The browser reports being offline, blame the problem on this.
    if (("onLine" in navigator) && !navigator.onLine) {
      throw new BrowserOfflineError(error);
    }

    var serverURL = diagnose.serverURL;
    var check;
    // If the user gave us a server URL to check whether the server is up at
    // all, use it. If that failed, then we need to check the connection. If we
    // do not have a server URL, then we need to check the connection right
    // away.
    if (serverURL) {
      // eslint-disable-next-line no-use-before-define
      check = ajax({ url: dedupURL(normalizeURL(serverURL)) })
        .catch(function failed() {
          return connectionCheck(error, diagnose);
        });
    }
    else {
      check = connectionCheck(error, diagnose);
    }

    return check.then(function success() {
      // All of our checks passed... and we have no tries left, so just rethrow
      // what we would have thrown in the first place.
      throw error;
    });
  }
317132
private function _errorConfig() {
        //error code config
        $error1 = (object) [
            'code' => 1,
            'resourceId' => false,
            'description' => 'Resource Not Found'
        ];

        $error2 = (object) [
            'code' => 2,
            'resourceId' => false,
            'description' => 'Circular Dependency Detected'
        ];

        $this->_errorCodes = [
            1 => $error1,
            2 => $error2
        ];
    }
147295
public function showErrors()
    {
        $key = sprintf('images.%s.file', $this->inputId());
        if (session('errors') && ($error = session('errors')->first($key))) {
            $this->help($error);
            $this->group->addClass('has-error');
        }
    }
1336563
function ErrorMsg()
	{
		if (!$this->_connectionID) return "No connection established";
		$errmsg = '';

		try {
			$errc = $this->_connectionID->Errors;
			if (!$errc) return "No Errors object found";
			if ($errc->Count == 0) return '';
			$err = $errc->Item($errc->Count-1);
			$errmsg = $err->Description;
		}catch(exception $e) {
		}
		return $errmsg;
	}
610233
public function checkErrors()
    {
        if ($this->model->hasErrors()) {
            $msg = array();
            foreach($this->model->getErrors() as $attribute => $errors) {
               $msg = array_merge($msg, $errors);
            }
            //todo: show several messages. should be checked in x-editable js
            //$this->error(join("\n", $msg));
            $this->error($msg[0]);
        }
    }
750420
public function debug(): void
    {
        foreach ($this->formatters as $locale => $formats) {
            echo "\n# $locale\n";
            foreach ($formats as $name => $format) {
                echo "## $name\n";
                echo "Locale: " . $format->getLocale(\Locale::VALID_LOCALE) . "\n" .
                     "DateType: " . $format->getDateType() . "\n" .
                     "TimeType: " . $format->getTimeType() . "\n" .
                     "Calendar: " . $format->getCalendar() . "\n" .
                     "Pattern: " . $format->getPattern() . "\n\n";
            }
        }
    }
907316
function errorPage(res, errMsg, publicMsg, useLayout) {
	if ( useLayout === undefined ) useLayout = true;
	console.log(errMsg);
	res.render('error', {
		layout: useLayout,
		errMsg: errMsg,
		publicMsg: publicMsg
	});			
}
320780
public function diagnose() {
        // Verify the database is running with READ_COMMITTED_SNAPSHOT enabled.
        // (that's required to get snapshots/row versioning on READ_COMMITED mode).
        $correctrcsmode = false;
        $sql = "SELECT is_read_committed_snapshot_on
                  FROM sys.databases
                 WHERE name = '{$this->dbname}'";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $result = sqlsrv_query($this->sqlsrv, $sql);
        $this->query_end($result);
        if ($result) {
            if ($row = sqlsrv_fetch_array($result)) {
                $correctrcsmode = (bool)reset($row);
            }
        }
        $this->free_result($result);

        if (!$correctrcsmode) {
            return get_string('mssqlrcsmodemissing', 'error');
        }

        // Arrived here, all right.
        return null;
    }