Create IsWarning function to check severity of error