Handle execution error and log it