Since we're not using `errMsg` outside of the switch block, could you remove the declaration here and put the `var` infront of the respective lines where `errMsg` is set?