Skip to content

Commit 40d4dc9

Browse files
committed
feat: improve error messages
1 parent fa67512 commit 40d4dc9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ async function main() {
104104
const configExists = existsSync(configPath);
105105

106106
if (!elf && !configExists) {
107-
console.error(`Error: wokwi.toml not found in ${path.resolve(rootDir)}`);
107+
console.error(`Error: wokwi.toml not found in ${path.resolve(rootDir)}.`);
108+
console.error('Run `wokwi-cli init` to automatically create a wokwi.toml file.');
108109
process.exit(1);
109110
}
110111

111112
if (!existsSync(diagramFilePath)) {
112113
console.error(`Error: diagram file not found in ${diagramFilePath}`);
114+
console.error('Run `wokwi-cli init` to automatically create a diagram.json file.');
113115
process.exit(1);
114116
}
115117

@@ -132,11 +134,13 @@ async function main() {
132134

133135
if (!existsSync(firmwarePath)) {
134136
console.error(`Error: firmware file not found: ${path.resolve(firmwarePath)}`);
137+
console.error('Please check the firmware path in your wokwi.toml configuration file.');
135138
process.exit(1);
136139
}
137140

138141
if (!existsSync(elfPath)) {
139142
console.error(`Error: ELF file not found: ${path.resolve(elfPath)}`);
143+
console.error('Please check the ELF path in your wokwi.toml configuration file.');
140144
process.exit(1);
141145
}
142146

0 commit comments

Comments
 (0)