The term "dangerous dog" and "potentially dangerous dog", as defined in section 14-51, shall not include the following: (1) A dog that inflicts an injury upon a person when the dog is being used by a law enforcement officer to carry out the law enforcement officer's official duties; or (2) A dog who inflicts an injury within the meaning of this article if the injury was sustained by a person who, at the time, was committing a willful trespass or other tort, or was tormenting, abusing or assaulting the dog, or had in the past observed or reported to have tormented, abused or assaulted the dog or was committing or attempting to commit a crime.