handle command exceptions