Skip to content

Conversation

@DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Apr 8, 2022

Storage select/pairs method responds with nil, err if something went
wrong. tuple-merger implementation of select/pairs do not support this
type of response, resulting in fail while trying to subscribe nil value.
The patch fixes this behavior by extracting second return value in case
of nil, err and wrapping it with errors wrapper to restore errors
metatable.

Closes #271

I didn't forget about

  • Tests
  • Changelog
  • Documentation (it is a fix)

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-271-select-nil-err-merger branch from 4078cfc to 5831f4b Compare April 8, 2022 08:16
Copy link
Contributor

@AnaNek AnaNek left a comment

Choose a reason for hiding this comment

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

Thanks for this fix! LGTM.

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-271-select-nil-err-merger branch from 5831f4b to 8004e0e Compare April 8, 2022 12:28
Storage select/pairs method responds with `nil, err` if something went
wrong. tuple-merger implementation of select/pairs do not support this
type of response, resulting in fail while trying to subscribe nil value.
The patch fixes this behavior by extracting second return value in case
of `nil, err` and wrapping it with errors wrapper to restore errors
metatable.

Closes #271
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-271-select-nil-err-merger branch from 8004e0e to 3abc35d Compare April 8, 2022 12:39
@DifferentialOrange
Copy link
Member Author

UPD: wrap net.box error to restore errors objects metatable, update test.

Copy link
Contributor

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

Thanks for the investigation! I don't see any downsides. LGTM so.

@DifferentialOrange DifferentialOrange merged commit c8d496b into master Apr 8, 2022
@DifferentialOrange DifferentialOrange deleted the DifferentialOrange/gh-271-select-nil-err-merger branch April 8, 2022 13:41
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.

Select with merger fails to process errors from storage

5 participants