From 5bbba8e47f842e0e1fb6857f0ecf02ff3a17f556 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 30 Mar 2024 02:52:34 +0900 Subject: [PATCH] throw exceptions on unreachable branches --- src/neovim.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neovim.ts b/src/neovim.ts index 2c32588..a1b6d41 100644 --- a/src/neovim.ts +++ b/src/neovim.ts @@ -19,7 +19,7 @@ function assetFileName(os: Os, version: string): string { case 'x64': return 'nvim-macos-x86_64.tar.gz'; default: - break; + throw Error(`Unsupported arch for Neovim ${version} on ${os}: ${process.arch}`); // Should be unreachable } } return 'nvim-macos.tar.gz'; @@ -68,7 +68,7 @@ export function assetDirName(version: string, os: Os): string { case 'x64': return 'nvim-macos-x86_64'; default: - break; + throw Error(`Unsupported arch for Neovim ${version} on ${os}: ${process.arch}`); // Should be unreachable } } return 'nvim-macos';