function DefaultExceptionSubscriber::getPriority

Same name in this branch
  1. 11.x core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber::getPriority()
Same name in other branches
  1. 9 core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber::getPriority()
  2. 9 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::getPriority()
  3. 8.9.x core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber::getPriority()
  4. 8.9.x core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::getPriority()
  5. 10 core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber::getPriority()
  6. 10 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::getPriority()

Overrides HttpExceptionSubscriberBase::getPriority

1 call to DefaultExceptionSubscriber::getPriority()
DefaultExceptionSubscriber::getPriority in core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php
Specifies the priority of all listeners in this class.
1 method overrides DefaultExceptionSubscriber::getPriority()
DefaultExceptionSubscriber::getPriority in core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php
Specifies the priority of all listeners in this class.

File

core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php, line 54

Class

DefaultExceptionSubscriber
Handles default error responses in serialization formats.

Namespace

Drupal\serialization\EventSubscriber

Code

protected static function getPriority() {
    // This will fire after the most common HTML handler, since HTML requests
    // are still more common than HTTP requests. But it has a lower priority
    // than \Drupal\Core\EventSubscriber\ExceptionJsonSubscriber::on4xx(), so
    // that this also handles the 'json' format. Then all serialization formats
    // (::getHandledFormats()) are handled by this exception subscriber, which
    // results in better consistency.
    return -70;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.