Improve SurveyAskOne stub error messages
This commit is contained in:
parent
90ec1089ef
commit
0cb4b7aaef
1 changed files with 5 additions and 1 deletions
|
|
@ -98,7 +98,11 @@ func InitAskStubber() (*AskStubber, func()) {
|
|||
}
|
||||
|
||||
if err := core.WriteAnswer(response, fieldName, userValue); err != nil {
|
||||
return fmt.Errorf("AskStubber failed writing the answer for field %q: %w", fieldName, err)
|
||||
topic := fmt.Sprintf("field %q", fieldName)
|
||||
if fieldName == "" {
|
||||
topic = fmt.Sprintf("%q", message)
|
||||
}
|
||||
return fmt.Errorf("AskStubber failed writing the answer for %s: %w", topic, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue