Open marcglasberg opened 4 months ago
Hi @marcglasberg, the condition for custom models and exceptions is that they be exported from models.dart
/exceptions.dart
, but do not have to be defined within.
So, you could have the following in exceptions.dart
(although you'd run into #35 because of Object?
).
export 'package:async_redux/async_redux.dart' show UserException;
// ... Other custom exception types.
I understand this requirement is a bit confusing and we're looking at better alternatives. In the meantime, I will go through our docs and see how we can better explain this.
That's great! I renamed this issue to Explain in the docs that Celest can serialize an exception imported from another package
. Just make it clear in the documentation.
Aaaand that's my cue. I'll get it updated ASAP!
Users of my Async Redux package can display an error dialog to the user by simply throwing a
UserException
which is provided by the package itself. For example:But now I want to modify this code to create a Celest function called
sell
that throws aUserException
internally:Since
UserException
is defined in the Async Redux package, I can't move it to theexceptions
directory.Is it possible to force Celest to accept/serialize an exception that I'll import from another package?