Fix printing of CommandErrors.

A previous change unintentionally removed the logging of messages
provided by CommandErrors before exiting the command. This
reintroduces the logging.error call.