-
Notifications
You must be signed in to change notification settings - Fork 193
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
stage-1: More useful error handler #239
Merged
samueldr
merged 22 commits into
mobile-nixos:master
from
samueldr-wip:feature/stage-1-gracefulier-errors-handling
Nov 14, 2020
Merged
stage-1: More useful error handler #239
samueldr
merged 22 commits into
mobile-nixos:master
from
samueldr-wip:feature/stage-1-gracefulier-errors-handling
Nov 14, 2020
+640
−228
Conversation
This file contains 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
Can be used as a single point of failure (hah!)
- Code is now more of a title - Only one code path exists to the applet
The command-line arguments are not great for structured data.
The applet isn't any more graceful yet, but this is where things can finally get interesting.
This also allows us to add library files.
First, right now we're putting the full error message front and center, rather than the sad phone. We're keeping the sad face though, but only as an accent icon. Finally, not part of this PR, we'll add actions to abort a total crash.
66ad1cf
to
263d671
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
First, the error handler now reserves most of the space for the error message.
Why didn't it before? Because it was conceived before we could print messages! We only had colours available to us to provide some kind of messaging. This is also why there was that sad-phone image; we couldn't show text, but we could show pictures, so let's make it obvious that things are wrong.
Thus, the sad phone is now gone, replaced with only a sad face icon at the top as a throw-back to the old times.
We're still providing the color-coded backgrounds, I think it is going to end-up useful, in case of vague bug reports. E.g. we'll know for a brown-ish error that init failed in an unexpected manner (exception).
Next, showing errors is great, but that's not the only thing we want to do on failure.
This is why we now have actions to do on failure! By default, a count-down is shown. Canceling it shows us a couple more options we can use.
The actions will show platform-specific options just like the recovery GUI does.
Future improvements
It might be of interest to allow spawning the recovery applet anyway, either as PID 1, or not. With an improved recovery applet that can handle some tasks like starting the usb networking or starting a background serial shell, even a foreground serial shell, that could help end-users in a bind.
Though, that might also require that we handle stage-1 failures in a less crashy way, and rather than kill our custom init, keep it going. Otherwise things could get messy if we implement them multiple times.
Anyway, these are all improvements for the future.