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

stage-1: More useful error handler #239

Merged

Conversation

@samueldr
Copy link
Member

@samueldr samueldr commented Nov 13, 2020

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.


image

samueldr added 2 commits Nov 13, 2020
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.
@samueldr samueldr force-pushed the samueldr-wip:feature/stage-1-gracefulier-errors-handling branch from 66ad1cf to 263d671 Nov 14, 2020
@samueldr samueldr merged commit 08e75d3 into NixOS:master Nov 14, 2020
3 checks passed
3 checks passed
Parse_nix Parse_nix
Details
Documentation Documentation
Details
Instantiation Instantiation
Details
@samueldr samueldr deleted the samueldr-wip:feature/stage-1-gracefulier-errors-handling branch Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant