optimization
compare if a type of error happened after knowing that there is an error