 .../EventSubscriber/DefaultExceptionSubscriber.php | 23 +---------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
index 99451df..bbcca6c 100644
--- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
@@ -153,7 +153,7 @@ protected function onFormatUnknown(GetResponseForExceptionEvent $event) {
    *   The event to process.
    */
   public function onException(GetResponseForExceptionEvent $event) {
-    $format = $this->getFormat($event->getRequest());
+    $format = $event->getRequest()->getRequestFormat();
     $exception = $event->getException();
 
     $method = 'on' . $format;
@@ -173,27 +173,6 @@ public function onException(GetResponseForExceptionEvent $event) {
   }
 
   /**
-   * Gets the error-relevant format from the request.
-   *
-   * @param \Symfony\Component\HttpFoundation\Request $request
-   *   The request object.
-   *
-   * @return string
-   *   The format as which to treat the exception.
-   */
-  protected function getFormat(Request $request) {
-    $format = $request->query->get(MainContentViewSubscriber::WRAPPER_FORMAT, $request->getRequestFormat());
-
-    // These are all JSON errors for our purposes. Any special handling for
-    // them can/should happen in earlier listeners if desired.
-    if (in_array($format, ['drupal_modal', 'drupal_dialog', 'drupal_ajax'])) {
-      $format = 'json';
-    }
-
-    return $format;
-  }
-
-  /**
    * Registers the methods in this class that should be listeners.
    *
    * @return array
