Skip to content

Commit

Permalink
Print errors from message watching
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Sep 17, 2024
1 parent 2772606 commit 50cbb5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flutter_package/bin/src/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,14 @@ Future<void> watchAndGenerateMessageCode(
var eventType = event.type.toString();
eventType = eventType[0].toUpperCase() + eventType.substring(1);
final fileRelativePath = relative(event.path, from: messagesPath);
removeCliLines(1);
final now = DateTime.now();
final formattedTime =
"${now.year}-${now.month.toString().padLeft(2, '0')}-"
"${now.day.toString().padLeft(2, '0')} "
"${now.hour.toString().padLeft(2, '0')}:"
"${now.minute.toString().padLeft(2, '0')}:"
"${now.second.toString().padLeft(2, '0')}";
removeCliLines(1);
print('$eventType: $fileRelativePath ($formattedTime)'.dim);
generated = false;
}
Expand All @@ -596,7 +596,8 @@ Future<void> watchAndGenerateMessageCode(
try {
await generateMessageCode(silent: true, messageConfig: messageConfig);
} catch (error) {
// Do nothing when message code generation has failed
removeCliLines(1);
print(error.toString().trim().red);
}
generated = true;
}
Expand Down

0 comments on commit 50cbb5b

Please sign in to comment.