Switch if branch to case statement
Update error message