Frontend: handle exceptions thrown by commands

Letting the frontend crash because a command failed is a bit too harsh.