Trap and log device errors