316
323
if (isinstance(exc_object, IOError)
317
324
and getattr(exc_object, 'errno', None) == errno.EPIPE):
318
325
print >>err_file, "bzr: broken pipe"
319
327
elif isinstance(exc_object, KeyboardInterrupt):
320
328
print >>err_file, "bzr: interrupted"
321
330
elif not getattr(exc_object, 'internal_error', True):
322
331
report_user_error(exc_info, err_file)
323
333
elif isinstance(exc_object, (OSError, IOError)):
324
334
# Might be nice to catch all of these and show them as something more
325
335
# specific, but there are too many cases at the moment.
326
336
report_user_error(exc_info, err_file)
328
339
report_bug(exc_info, err_file)
331
343
# TODO: Should these be specially encoding the output?