From e09a367988bd65cd7ab5bf6e00dbb999d6c874b7 Mon Sep 17 00:00:00 2001 From: Zoey Date: Tue, 16 Dec 2025 11:49:38 +0100 Subject: [PATCH] certbot show error --- frontend/src/api/backend/base.ts | 4 +++- frontend/src/modals/DNSCertificateModal.tsx | 13 ++++++++++++- frontend/src/modals/HTTPCertificateModal.tsx | 13 ++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/frontend/src/api/backend/base.ts b/frontend/src/api/backend/base.ts index 9c289755..d3d37626 100644 --- a/frontend/src/api/backend/base.ts +++ b/frontend/src/api/backend/base.ts @@ -48,9 +48,11 @@ async function processResponse(response: Response) { queryClient.clear(); window.location.reload(); } - throw new Error( + const error = new Error( typeof payload.error.messageI18n !== "undefined" ? payload.error.messageI18n : payload.error.message, ); + (error as any).payload = payload; + throw error; } return camelizeKeys(payload) as any; } diff --git a/frontend/src/modals/DNSCertificateModal.tsx b/frontend/src/modals/DNSCertificateModal.tsx index 3c97fddd..d4a12877 100644 --- a/frontend/src/modals/DNSCertificateModal.tsx +++ b/frontend/src/modals/DNSCertificateModal.tsx @@ -28,7 +28,18 @@ const DNSCertificateModal = EasyModal.create(({ visible, remove }: InnerModalPro showObjectSuccess("certificate", "saved"); remove(); } catch (err: any) { - setErrorMsg(); + if (err.payload?.debug?.stack) { + setErrorMsg( + <> + +
+							{err.payload.debug.stack.join("\n")}
+						
+ , + ); + } else { + setErrorMsg(); + } } queryClient.invalidateQueries({ queryKey: ["certificates"] }); setIsSubmitting(false); diff --git a/frontend/src/modals/HTTPCertificateModal.tsx b/frontend/src/modals/HTTPCertificateModal.tsx index b996a7d6..8cf83096 100644 --- a/frontend/src/modals/HTTPCertificateModal.tsx +++ b/frontend/src/modals/HTTPCertificateModal.tsx @@ -32,7 +32,18 @@ const HTTPCertificateModal = EasyModal.create(({ visible, remove }: InnerModalPr showObjectSuccess("certificate", "saved"); remove(); } catch (err: any) { - setErrorMsg(); + if (err.payload?.data?.debug?.stack) { + setErrorMsg( + <> + +
+							{err.payload.data.debug.stack.join("\n")}
+						
+ , + ); + } else { + setErrorMsg(); + } } queryClient.invalidateQueries({ queryKey: ["certificates"] }); setIsSubmitting(false);