Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ThrowableUtils.php

function ThrowableUtils::getSeverity

2 calls to ThrowableUtils::getSeverity()
ErrorHandler::handleException in vendor/symfony/error-handler/ErrorHandler.php
Handles an exception by logging then forwarding it to another handler.
ErrorHandler::setLoggers in vendor/symfony/error-handler/ErrorHandler.php
Sets a logger for each error level.

File

vendor/symfony/error-handler/ThrowableUtils.php, line 21

Class

ThrowableUtils
@internal

Namespace

Symfony\Component\ErrorHandler

Code

public static function getSeverity(SilencedErrorContext|\Throwable $throwable) : int {
    if ($throwable instanceof \ErrorException || $throwable instanceof SilencedErrorContext) {
        return $throwable->getSeverity();
    }
    if ($throwable instanceof \ParseError) {
        return \E_PARSE;
    }
    if ($throwable instanceof \TypeError) {
        return \E_RECOVERABLE_ERROR;
    }
    return \E_ERROR;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal