Skip to content

Commit

Permalink
fix(nuxt3-module): maintenance mode (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanilowicz authored Dec 6, 2024
1 parent 3e930cf commit 05a4792
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-cobras-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopware-pwa/nuxt3-module": patch
---

Replace `createError` with `showError` function in the `onResponseError` hook to redirect the user to the Nuxt error page.
4 changes: 2 additions & 2 deletions packages/nuxt3-module/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
useRuntimeConfig,
useState,
createShopwareContext,
createError,
showError,
} from "#imports";
import { ref } from "vue";
import Cookies from "js-cookie";
Expand Down Expand Up @@ -82,7 +82,7 @@ export default defineNuxtPlugin((NuxtApp) => {
// @ts-expect-error TODO: check maintenance mode and fix typongs here
const error = isMaintenanceMode(response._data?.errors ?? []);
if (error) {
throw createError({
throw showError({
statusCode: 503,
statusMessage: "MAINTENANCE_MODE",
});
Expand Down

0 comments on commit 05a4792

Please sign in to comment.