Skip to content

Commit 38faa16

Browse files
fix boot return logic
1 parent 12facc2 commit 38faa16

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/kernel.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,15 @@ export class Kernel {
172172
return false;
173173
}
174174

175-
init.completion.then((exit_code) => {
175+
try {
176+
const exit_code = await init.completion;
177+
176178
this.panic(`init program ${init_program} exited ${exit_code === 0 ? "unexpectedly" : "with an error"}!`, `Exit code: ${exit_code}`);
177179
return false;
178-
}).catch((e) => {
180+
} catch (e) {
179181
this.panic(`init program ${init_program} error!`, e.toString());
180182
return false;
181-
});
183+
}
182184
} catch (e) {
183185
this.panic(`Failed to start init program ${init_program}!`, e.toString());
184186
return false;

0 commit comments

Comments
 (0)