Commit 5e27def7 authored by intrigeri's avatar intrigeri
Browse files

Persistence setup: encode output when displaying errors on stdout

This avoids a "wide character" error that crashes the program and eventually
prevents displaying the error dialog to the user.
parent 53fc0788
......@@ -10,12 +10,14 @@ use Moo::Role;
use MooX::late;
use namespace::clean;
requires 'encoding';
method display_error (
(InstanceOf['Gtk3::Window']) $main_window,
Str $title,
Str $mesg
) {
say STDERR "$title: $mesg";
say STDERR $self->encoding->encode("$title: $mesg");
my $dialog = Gtk3::MessageDialog->new(
$main_window, 'destroy-with-parent', 'error', 'ok',
......@@ -38,9 +38,9 @@ use Moo;
use MooX::late;
use MooX::HandlesVia;
with 'Tails::Role::HasEncoding';
with 'Tails::Role::DisplayError::Gtk3';
with 'Tails::Role::HasDBus::System';
with 'Tails::Role::HasEncoding';
use namespace::clean;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment