improved error logging on command failure