diff --git a/src/app/modules/submission/encrypt-submission/encrypt-submission.controller.ts b/src/app/modules/submission/encrypt-submission/encrypt-submission.controller.ts index 0cc100b502..4cf91851a3 100644 --- a/src/app/modules/submission/encrypt-submission/encrypt-submission.controller.ts +++ b/src/app/modules/submission/encrypt-submission/encrypt-submission.controller.ts @@ -119,12 +119,12 @@ const submitEncryptModeForm: ControllerHandler< meta: logMeta, error: formPublicResult.error, }) - const { statusCode } = mapRouteError(formPublicResult.error) + const { statusCode, errorMessage } = mapRouteError(formPublicResult.error) if (statusCode === StatusCodes.GONE) { return res.sendStatus(statusCode) } else { return res.status(statusCode).json({ - message: form.inactiveMessage, + message: errorMessage, }) } } diff --git a/src/app/modules/submission/encrypt-submission/encrypt-submission.utils.ts b/src/app/modules/submission/encrypt-submission/encrypt-submission.utils.ts index 503b6e0088..95994ae811 100644 --- a/src/app/modules/submission/encrypt-submission/encrypt-submission.utils.ts +++ b/src/app/modules/submission/encrypt-submission/encrypt-submission.utils.ts @@ -119,7 +119,8 @@ const errorMapper: MapRouteError = ( case PrivateFormError: return { statusCode: StatusCodes.NOT_FOUND, - errorMessage: error.message, + errorMessage: + 'This form has been taken down. For assistance, please contact the person who asked you to fill in this form.', } case CaptchaConnectionError: return {