From 6f84fd3f711f6e49d693927ee1f04e2758486469 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 31 Jan 2023 11:29:55 +0100 Subject: [PATCH] Use correct error object to avoid crash --- src/routes/support.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/support.js b/src/routes/support.js index 8e0f527d9..d193eb0e7 100644 --- a/src/routes/support.js +++ b/src/routes/support.js @@ -48,7 +48,7 @@ async function createTicket(req, res, next) { if (supportConfig.email !== constants.SUPPORT_EMAIL) return next(new HttpError(503, 'Sending to non-cloudron email not implemented yet')); const [ticketError, result] = await safe(appstore.createTicket(_.extend({ }, req.body, { email: req.user.email, displayName: req.user.displayName }), AuditSource.fromRequest(req))); - if (ticketError) return next(new HttpError(503, `Error contacting cloudron.io: ${error.message}. Please email ${constants.SUPPORT_EMAIL}`)); + if (ticketError) return next(new HttpError(503, `Error contacting cloudron.io: ${ticketError.message}. Please email ${constants.SUPPORT_EMAIL}`)); next(new HttpSuccess(201, result)); }