Skip to content

Commit ef02bd4

Browse files
chore: throw Error if provided path is not found
1 parent 490c666 commit ef02bd4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

packages/nuxt/src/vite/utils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ export async function findDefaultSdkInitFile(
4242
if (fs.existsSync(resolvedPath)) {
4343
return resolvedPath;
4444
}
45-
} catch {
46-
// Fails silently as the file is optional
45+
throw new Error(`Server configuration file not found: ${resolvedPath}`);
46+
} catch (e) {
47+
throw new Error(`Error resolving server configuration file: ${options.serverConfigFile}. Cause: ${e}`);
4748
}
4849
}
4950
for (const ext of possibleFileExtensions) {
@@ -57,8 +58,9 @@ export async function findDefaultSdkInitFile(
5758
if (fs.existsSync(resolvedPath)) {
5859
return resolvedPath;
5960
}
60-
} catch {
61-
// Fails silently as the file is optional
61+
throw new Error(`Client configuration file not found: ${resolvedPath}`);
62+
} catch (e) {
63+
throw new Error(`Error resolving client configuration file: ${options.clientConfigFile}. Cause: ${e}`);
6264
}
6365
}
6466
for (const ext of possibleFileExtensions) {

0 commit comments

Comments
 (0)