Skip to content

Commit 7765ee0

Browse files
committed
fix(server): correct entrypoint logic and linter warnings
Removes the `await` from the `server.main()` call in the custom entrypoint, as the function returns `void`. Also removes redundant `// ignore: avoid_print` comments that were duplicated by a file-level ignore, resolving linter warnings.
1 parent 22d92ea commit 7765ee0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bin/main.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,14 @@ Future<void> main(List<String> args) async {
2626
Logger.root.level = Level.ALL;
2727
Logger.root.onRecord.listen((record) {
2828
// A more detailed logger that includes the error and stack trace.
29-
// ignore: avoid_print
3029
print(
3130
'${record.level.name}: ${record.time}: ${record.loggerName}: '
3231
'${record.message}',
3332
);
3433
if (record.error != null) {
35-
// ignore: avoid_print
3634
print(' ERROR: ${record.error}');
3735
}
3836
if (record.stackTrace != null) {
39-
// ignore: avoid_print
4037
print(' STACK TRACE: ${record.stackTrace}');
4138
}
4239
});
@@ -53,7 +50,9 @@ Future<void> main(List<String> args) async {
5350
log.info('EAGER_INIT: Starting Dart Frog server...');
5451

5552
// Only if initialization succeeds, start the Dart Frog server.
56-
await server.main();
53+
// This function is void and handles its own async logic internally,
54+
// so it should be called without `await`.
55+
server.main();
5756
} catch (e, s) {
5857
log.severe('EAGER_INIT: FATAL: Failed to start server.', e, s);
5958
exit(1); // Exit with a non-zero code to indicate failure.

0 commit comments

Comments
 (0)