fix(input): return (nil, err) on read_query_answer timeout#202
Merged
Tieske merged 4 commits intolunarmodules:mainfrom Feb 21, 2026
Merged
Conversation
Member
|
this code is actually there on purpose. It's unclear to me wehther this could ever happen. Hence the "this is unexpected" error, to ensure we'd get feedback if it ever did happen. That said, whenever you think something cannot happen, it typically happens. So maybe this is a good change. Wdyt? |
Contributor
Author
|
@Tieske I understand that using error() makes sure we notice if something truely happen which is causing a crash. My reasoning was mostly about API boundaries most of the input layer follows our new (value, err) pattern, so throwing here forces downstream callers to wrap in pcall(), which feels inconsistent with the rest of the module’s public surface. |
Tieske
requested changes
Feb 20, 2026
Tieske
reviewed
Feb 21, 2026
Tieske
reviewed
Feb 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace
error()inread_query_answer()withreturn nil, "timeout: no response from terminal".This aligns the function with our
(value, err)returnconvention which has beed used throughout the input module and CLI widgets.
query()already uses this pattern.Adds LDoc notes for the error return and Busted tests covering
timeout behavior in both
read_query_answer()andquery().There is No behavioral change except preventing a hard crash on timeout.