Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't clear out errorcode or errormessage when using the paramaterless version of ToReturnOptionObject() #52

Closed
adrianstovall71 opened this issue Jan 24, 2023 · 2 comments · Fixed by #82
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@adrianstovall71
Copy link

My team has noticed that calling ToReturnOptionObject() clears any values set in errorcode or errormessage. That may be the intended behavior, but it was definitely unexpected. I would expect to need to set errorcode 0 or the equivalent enum value to clear those fields. What do you think about not clearing them unless error code 0 is specified?

@scottolsonjr
Copy link
Contributor

You are correct. The default method was envisioned a convenient way to return a successful response with the parameterized override allowing for setting other error codes or messages. I had not considered that the error code and message would have been set prior to this step.

I agree that this assumption is incorrect and that this method should not overwrite the existing values if present. However, something worth considering is whether the ToReturnOptionObject() is still needed in this use case if it has already been configured for return.

The ToReturnOptionObject() method performs the following actions to prepare the OptionObject for return:

  1. Clones the OptionObject.
  2. Removes unedited rows to trim down the payload and address some errors previously seen in the myAvatar UI in testing.
  3. Sets the ErrorCode and ErrorMesg.

I suspect in this use case the method is still valuable for step 2 despite step 3 being handled earlier in the process.

@scottolsonjr scottolsonjr added bug Something isn't working enhancement New feature or request labels Jan 28, 2023
@scottolsonjr scottolsonjr added this to the v1.2 milestone Jan 28, 2023
@adrianstovall71
Copy link
Author

adrianstovall71 commented Jan 28, 2023 via email

@scottolsonjr scottolsonjr self-assigned this Jun 18, 2023
@scottolsonjr scottolsonjr linked a pull request Jun 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants