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

crud: support operation_data field in errors #331

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

askalt
Copy link

@askalt askalt commented Aug 21, 2023

This patch adds operation_data decoding for the crud.Error.

The operation_data type is determined as rowType in crud.Result.

Also, according to [1], an error can contain one of the following:

  • an error
  • an array of errors
  • nil

So the error decoding logic has been modified to consider each case, in order to avoid comparing an error to nil.

  1. https://github.com/tarantool/crud/tree/master#api

I didn't forget about (remove if it is not applicable):

Closes #330

crud/error.go Outdated Show resolved Hide resolved
crud/example_test.go Show resolved Hide resolved
@askalt askalt force-pushed the askalt/gh-330-support-operation-data branch 2 times, most recently from 45514fc to 5cd7534 Compare August 22, 2023 07:12
@askalt askalt force-pushed the askalt/gh-330-support-operation-data branch 3 times, most recently from fb1345a to adc116f Compare August 22, 2023 19:02
@askalt askalt force-pushed the askalt/gh-330-support-operation-data branch from adc116f to 7ce2007 Compare August 23, 2023 07:24
This patch adds `operation_data` decoding for the `crud.Error`.

The `operation_data` type is determined as `rowType` in `crud.Result`.

Also, according to [1], an error can contain one of the following:
- an error
- an array of errors
- nil

So the error decoding logic has been modified to consider each case,
in order to avoid comparing an error to nil.

1. https://github.com/tarantool/crud/tree/master#api

Closes #330
@oleg-jukovec oleg-jukovec merged commit d8df65d into master Aug 23, 2023
22 checks passed
@oleg-jukovec oleg-jukovec deleted the askalt/gh-330-support-operation-data branch August 23, 2023 07:44
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.

crud: support operation_data in errors
3 participants