From 028ced0ac61cf7dc62feb44d40f4841e6c265d07 Mon Sep 17 00:00:00 2001 From: Sten Govaerts Date: Tue, 26 Nov 2024 21:52:41 +0100 Subject: [PATCH] Add question id to error --- src/Services/SurveyMappingService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/SurveyMappingService.php b/src/Services/SurveyMappingService.php index 01289f5..b179b45 100644 --- a/src/Services/SurveyMappingService.php +++ b/src/Services/SurveyMappingService.php @@ -195,7 +195,8 @@ public function findQuestionField(SurveyContract $survey, string $questionId, ?s } } //in case nothing is found there is no mapping for the question -> throw error - throw QuestionNotMappedException::create($subquestionId ?? $questionId, 'The question mapping has no field'); + $errorQuestion = $subquestionId ?? $questionId; + throw QuestionNotMappedException::create($errorQuestion, "The question mapping for question {$errorQuestion} has no field."); } private function getQuestionMapper(string $surveyheroFieldType): ?QuestionMapper