 src/Normalizer/HttpExceptionNormalizer.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Normalizer/HttpExceptionNormalizer.php b/src/Normalizer/HttpExceptionNormalizer.php
index 409fff0..437887c 100644
--- a/src/Normalizer/HttpExceptionNormalizer.php
+++ b/src/Normalizer/HttpExceptionNormalizer.php
@@ -79,8 +79,12 @@ class HttpExceptionNormalizer extends NormalizerBase {
       'links' => [
         'info' => $this->getInfoUrl($status_code),
       ],
-      'code' => $exception->getCode(),
     ];
+    // Exceptions thrown without an explicitly defined code get assigned zero by
+    // default. Since this is no helpful information, omit it.
+    if ($exception->getCode() !== 0) {
+      $error['code'] = $exception->getCode();
+    }
     if ($this->currentUser->hasPermission('access site reports')) {
       // The following information may contain sensitive information. Only show
       // it to authorized users.
