Skip to content

LG-7417 Standardize failure responses#7006

Merged
ThatSpaceGuy merged 13 commits intomainfrom
LG-7417-Failure-response-work
Sep 24, 2022
Merged

LG-7417 Standardize failure responses#7006
ThatSpaceGuy merged 13 commits intomainfrom
LG-7417-Failure-response-work

Conversation

@ThatSpaceGuy
Copy link
Contributor

changelog: Internal, Attempts API, Standardize events

@ThatSpaceGuy ThatSpaceGuy requested a review from a team September 22, 2022 16:29
Copy link
Contributor

@Rwolfe-Nava Rwolfe-Nava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Much needed work. Thank you!

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@n1zyy n1zyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This turned out great! Thanks for running with this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explaining in case anyone else finds themselves wondering, "Shouldn't Osman's PR have caused this to not show up anyway?"

No, because we're still calling the event with failure_reason, it's just getting stripped out before it's returned to the user. (By design.)

@ThatSpaceGuy ThatSpaceGuy force-pushed the LG-7417-Failure-response-work branch from 7ec9799 to 882cbf0 Compare September 23, 2022 16:14

def parse_failure_reason(result)
return result.to_h[:error_details] || result.errors.presence
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked out well!

(Realistically this only makes sense for form response type objects, but I think it makes enough sense to just keep here, and a name like parse_failure_reason_from_form_response might be a bit much.)

@ThatSpaceGuy ThatSpaceGuy merged commit 54cd883 into main Sep 24, 2022
@ThatSpaceGuy ThatSpaceGuy deleted the LG-7417-Failure-response-work branch September 24, 2022 14:23
@solipet solipet mentioned this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants