When a defendant is held to answer on a charge of misdemeanor, for which the person injured by the act constituting the offense has a remedy by a civil action, the offense may be compromised as provided in the next section, except when it is committed:
(1) By or upon an officer of justice, while in the execution of the duties of his office.
(2) Riotously.
(3) With an intent to commit a felony.
(4) As an act of domestic violence as defined in section 39-6303(1), Idaho Code.