function DefaultExceptionSubscriber::getPriority
Specifies the priority of all listeners in this class.
The default priority is 1, which is very low. To have listeners that have a "first attempt" at handling exceptions return a higher priority.
Return value
int The event priority of this subscriber.
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\EventSubscriberCode
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.