From 27adcb98745cc25068ffba5f25d2140ec53a0569 Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Mon, 22 Jan 2024 18:39:51 -0800 Subject: [PATCH] chore(core): Improve SerializationException message 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;