getLevelName needs to be called earlier, so it can still thrown
exceptions for invalid levels even without a handler