If any suit in any court of record in this state is dismissed on account of the negligence of any attorney at law, or for his nonattendance at the court without having a just and reasonable excuse for such absence, it shall be at the costs of the attorney at law. Such attorney at law shall be liable for all damages his client may have sustained by the dismissal or by any other neglect by the attorney at law of his duty, in an action in any court within this state having jurisdiction thereof.