-
Notifications
You must be signed in to change notification settings - Fork 31
checked exceptions in stores #1179
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e55b110
checked exceptions in stores
marcinczenko 3c525d4
makes asynciter as much exception safe as it gets
marcinczenko 87bcf14
introduce "SafeAsyncIter" that uses Results and limits exceptions to …
marcinczenko ecf515d
adds {.push raises: [].} to errors
marcinczenko f5ea783
uses SafeAsyncIter in "listBlocks" and in "getBlockExpirations"
marcinczenko e6731a9
simplifies safeasynciter (magic of auto)
marcinczenko 4d74fff
gets rid of ugly casts
marcinczenko ec15164
Merge branch 'master' into checked-exceptions-in-stores
dryajov 765a342
tiny fix in hte way we create raising futures in tests of safeasynciter
marcinczenko 2bad681
Merge branch 'master' into checked-exceptions-in-stores
marcinczenko 90519c7
Merge branch 'master' into checked-exceptions-in-stores
dryajov 5e97203
Removes two more casts caused by using checked exceptions
marcinczenko 60c81df
adds an extended explanation of one more complex SafeAsyncIter test
marcinczenko 6e2106a
adds missing "finishOnErr" param in slice constructor of SafeAsyncIter
marcinczenko 1e2afd8
better fix for "Error: Exception can raise an unlisted exception: Exc…
marcinczenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, why
auto
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to support "raising" futures as arguments of generic procs. I cover it in the section "Generic Types" in the presentation I was showing during offsite: https://drive.proton.me/urls/Q562MNN8VG#6iy1sTyjagcW.
We cannot explicitly specify a generic raising future type as an argument and this function is used in
fetchBatched
(codex/node.nim
):Here,
blockFutures
is a sequence of raising futures:seq[InternalRaisesFuture[Result[blocktype.Block, ref CatchableError], (CancelledError,)]]
. If we hadseq[Future[T]]
instead ofauto
inallFinishedValues
, we would get the following compilation error:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is fine, but 🤔