diff --git a/jsonapi.services.yml b/jsonapi.services.yml
index 23325e1..9747fa2 100644
--- a/jsonapi.services.yml
+++ b/jsonapi.services.yml
@@ -88,3 +88,8 @@ services:
   plugin.manager.resource.processor:
     class: Drupal\jsonapi\Plugin\JsonApiResourceManager
     parent: default_plugin_manager
+  jsonapi.exception_subscriber:
+    class: Drupal\jsonapi\EventSubscriber\ExceptionSubscriber
+    arguments: ['@request_stack', '@serializer']
+    tags:
+      - { name: event_subscriber }
diff --git a/src/EventSubscriber/ExceptionSubscriber.php b/src/EventSubscriber/ExceptionSubscriber.php
new file mode 100644
index 0000000..06cf502
--- /dev/null
+++ b/src/EventSubscriber/ExceptionSubscriber.php
@@ -0,0 +1,89 @@
+<?php
+
+namespace Drupal\jsonapi\EventSubscriber;
+
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
+use Symfony\Component\HttpKernel\Exception\HttpException;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\Serializer\SerializerInterface;
+
+/**
+ * Redirects users when access is denied.
+ *
+ * Anonymous users are taken to the login page when attempting to access the
+ * user profile pages. Authenticated users are redirected from the login form to
+ * their profile page and from the user registration form to their profile edit
+ * form.
+ */
+class ExceptionSubscriber implements EventSubscriberInterface {
+
+  /**
+   * The current request.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $currentRequest;
+
+  /**
+   * The serializer.
+   *
+   * @var \Symfony\Component\Serializer\Serializer
+   */
+  protected $serializer;
+
+  /**
+   * Constructs a new redirect subscriber.
+   *
+   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+   */
+  public function __construct(RequestStack $request_stack, SerializerInterface $serializer) {
+    $this->currentRequest = $request_stack;
+    $this->serializer = $serializer;
+  }
+
+  /**
+   * Handle exception event for JSON API requests.
+   *
+   * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event
+   *   The event to process.
+   */
+  public function onException(GetResponseForExceptionEvent $event) {
+    // @todo Check if applies.
+    // Check if route is the JSON API route.
+    //$this->currentRequest;
+
+    $exception = $event->getException();
+
+    if (!$exception instanceof HttpExceptionInterface) {
+      // If this is a generic exception, generate a Server Exception HTTP
+      // exception and process it.
+      $status = 500;
+      $exception = new HttpException($status, $exception->getMessage(), $exception);
+      $event->setException($exception);
+    }
+    else {
+      $status = $exception->getStatusCode();
+    }
+
+    $format = $this->currentRequest->getRequestFormat();
+    $content = $this->serializer->serialize($exception, $format);
+    // Add the default content type, but only if the headers from the
+    // exception have not specified it already.
+    $headers = $exception->getHeaders() + array('Content-Type' => $this->currentRequest->getMimeType($format));
+    $response = new Response($content, $status, $headers);
+    $event->setResponse($response);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getSubscribedEvents() {
+    $events[KernelEvents::EXCEPTION][] = ['onException'];
+    return $events;
+  }
+
+}
diff --git a/src/RequestHandler.php b/src/RequestHandler.php
index e476781..1c921f8 100644
--- a/src/RequestHandler.php
+++ b/src/RequestHandler.php
@@ -78,21 +78,7 @@ class RequestHandler extends RestRequestHandler {
     /** @var \Drupal\jsonapi\Error\ErrorHandlerInterface $error_handler */
     $error_handler = $this->container->get('jsonapi.error_handler');
     $error_handler->register();
-    try {
-      $response = call_user_func_array([$resource, $action], array_merge($parameters, $extra_parameters));
-    }
-    catch (\Exception $error_exception) {
-      if (!$error_exception instanceof HttpExceptionInterface) {
-        // If this is a generic exception, generate a Server Exception HTTP
-        // exception and process it.
-        $error_exception = new HttpException(500, $error_exception->getMessage(), $error_exception);
-      }
-      $content = $serializer->serialize($error_exception, $format);
-      // Add the default content type, but only if the headers from the
-      // exception have not specified it already.
-      $headers = $error_exception->getHeaders() + array('Content-Type' => $request->getMimeType($format));
-      $response = new Response($content, $error_exception->getStatusCode(), $headers);
-    }
+    $response = call_user_func_array([$resource, $action], array_merge($parameters, $extra_parameters));
     $error_handler->restore();
 
     return $response instanceof ResourceResponse ?
@@ -127,24 +113,12 @@ class RequestHandler extends RestRequestHandler {
     $data = $response->getResponseData();
     $context = new RenderContext();
     $cacheable_metadata = $response->getCacheableMetadata();
+    $error_handler->register();
     $output = $this->container->get('renderer')
       ->executeInRenderContext($context, function () use ($serializer, $data, $format, $request, $cacheable_metadata, $error_handler, $response) {
-        $error_handler->register();
-        try {
-          $content = $serializer->serialize($data, $format, ['request' => $request, 'cacheable_metadata' => $cacheable_metadata]);
-        }
-        catch (\Exception $error_exception) {
-          if (!$error_exception instanceof HttpExceptionInterface) {
-            // If this is a generic exception, generate a Server Exception HTTP
-            // exception and process it.
-            $error_exception = new HttpException(500, $error_exception->getMessage(), $error_exception);
-          }
-          $content = $serializer->serialize($error_exception, $format);
-          $response->setStatusCode($error_exception->getStatusCode());
-        }
-        $error_handler->restore();
-        return $content;
+        return $serializer->serialize($data, $format, ['request' => $request, 'cacheable_metadata' => $cacheable_metadata]);
       });
+    $error_handler->restore();
     $response->setContent($output);
     if (!$context->isEmpty()) {
       $response->addCacheableDependency($context->pop());
@@ -189,16 +163,11 @@ class RequestHandler extends RestRequestHandler {
       ]);
     }
     catch (UnexpectedValueException $e) {
-      $error_exception = new HttpException(
+      throw new HttpException(
         422,
         sprintf('There was an error un-serializing the data. Message: %s.', $e->getMessage()),
         $e
       );
-      $content = $serializer->serialize($error_exception, $format);
-      // Add the default content type, but only if the headers from the
-      // exception have not specified it already.
-      $headers = $error_exception->getHeaders() + array('Content-Type' => $request->getMimeType($format));
-      return new Response($content, $error_exception->getStatusCode(), $headers);
     }
   }
 
