From 8082781a9551a86498d03295d36c3294d6abc76f Mon Sep 17 00:00:00 2001 From: Dillon Nys <24740863+dnys1@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:55:40 -0800 Subject: [PATCH] chore(core): Improve SerializationException message (#10) While this exception can be thrown on the client or server, it is only thrown on the client by fault of the user. And there is only one reason why this would be the case. --- packages/celest_core/CHANGELOG.md | 1 + packages/celest_core/lib/src/serialization/serializer.dart | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/celest_core/CHANGELOG.md b/packages/celest_core/CHANGELOG.md index 0d9be903..3e355457 100644 --- a/packages/celest_core/CHANGELOG.md +++ b/packages/celest_core/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.1.1-wip - Update README +- Improve error message of `SerializationException` ## 0.1.0 diff --git a/packages/celest_core/lib/src/serialization/serializer.dart b/packages/celest_core/lib/src/serialization/serializer.dart index 1b6bf06f..03206109 100644 --- a/packages/celest_core/lib/src/serialization/serializer.dart +++ b/packages/celest_core/lib/src/serialization/serializer.dart @@ -109,7 +109,8 @@ final class _Serializers extends Serializers { final serializer = get(); if (serializer == null) { throw SerializationException( - 'No serializer found for $Dart. Did you forget to put() it?', + 'No serializer found for $Dart. Did you forget to call `celest.init()` ' + "at the start of your Flutter app's `main` function?", ); } return serializer;