@timber-js/app 0.2.0-alpha.62 → 0.2.0-alpha.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -954,10 +954,11 @@ var VersionSkewError = class extends Error {
954
954
  }
955
955
  };
956
956
  /**
957
- * Thrown when the server returns a 5xx error for an RSC payload request.
957
+ * Thrown when the server returns an error for an RSC payload request.
958
958
  * The server sends X-Timber-Error header and a JSON body instead of a
959
- * broken RSC stream. Caught in navigate() to trigger a hard navigation
960
- * so the server can render the error page as HTML.
959
+ * broken RSC stream for any RenderError (4xx or 5xx). Caught in
960
+ * navigate() to trigger a hard navigation so the server can render
961
+ * the error page as HTML.
961
962
  *
962
963
  * See design/10-error-handling.md §"Error Page Rendering for Client Navigation"
963
964
  */
@@ -994,7 +995,7 @@ async function fetchRscPayload(url, deps, stateTree, currentUrl) {
994
995
  if (checkReloadSignal(response)) throw new VersionSkewError();
995
996
  const redirectLocation = response.headers.get("X-Timber-Redirect") || (response.status >= 300 && response.status < 400 ? response.headers.get("Location") : null);
996
997
  if (redirectLocation) throw new RedirectError(redirectLocation);
997
- if (response.headers.get("X-Timber-Error") === "1" && response.status >= 500) throw new ServerErrorResponse(response.status, url);
998
+ if (response.headers.get("X-Timber-Error") === "1") throw new ServerErrorResponse(response.status, url);
998
999
  headElements = extractHeadElements(response);
999
1000
  segmentInfo = extractSegmentInfo(response);
1000
1001
  params = extractParams(response);