aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/ui/command_line.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/ui/command_line.py')
-rw-r--r--libbe/ui/command_line.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index 89d791d..dd10954 100644
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -267,6 +267,14 @@ def dispatch(ui, command, args):
ret = ui.run(command, options, args)
except CallbackExit:
return 0
+ except UnicodeDecodeError, e:
+ print >> ui.io.stdout, '\n'.join([
+ 'ERROR:', str(e),
+ 'You should set a locale that supports unicode, e.g.',
+ ' export LANG=en_US.utf8',
+ 'See http://docs.python.org/library/locale.html for details',
+ ])
+ return 1
except libbe.command.UserError, e:
print >> ui.io.stdout, 'ERROR:\n', e
return 1