Have you ran it to see what happens?

Also, Enums can be compared with double equals. error == getLevel() (assuming they are both Level enums) can be used.