Follow-up: Only use ServiceResponse from UpdateService in ServiceDeskHandler
The following discussion from !123681 (merged) should be addressed:
-
@splattael started a discussion: (+2 comments) Suggestion It seems we are discarding the service response. Thoughts on logging a message in case of an error?
🤔 I also wonder if we could provide a
reason
for everyServiceResponse
error and use thisreason
to decide whether we've handled email verification or not.Something like:
def handled_custom_email_address_verification? response = ::ServiceDesk::CustomEmailVerifications::UpdateService.new( project: project, current_user: nil, params: { mail: mail } ).execute return false if response.reason == :not_a_verification_subaddress if response.error? # Log error end true
WDYT?
From !123681 (comment 1432823946)
# Real known verification error
ServiceResponse.error(
message: _('ServiceDesk|Custom email address could not be verified.'),
reason: :verification_failed
payload: {
error: error_identifier.to_s
}
)
# Not a verification subaddress
ServiceResponse.error(
message: _('ServiceDesk|TBD'),
reason: :not_a_verification_subaddress
)
# FF not enabled
ServiceResponse.error(
message: _('ServiceDesk|TBD'),
reason: :feature_flag_not_enabled
)