Error propagation UI#4
Conversation
| /** | ||
| * Converts a GiphRsError to a standard Kotlin Exception | ||
| */ | ||
| fun GiphRsError.toException(): Exception { |
There was a problem hiding this comment.
This gets translated by UniFFI to GiphRsException which is an Exception
There was a problem hiding this comment.
Is this redundant then? Should I remove this function?
There was a problem hiding this comment.
Fix this, should be GiphRSException now.
There was a problem hiding this comment.
| @@ -53,7 +54,7 @@ impl RustViewModel { | |||
| } | |||
|
|
|||
| pub fn has_error(&self) -> bool { | |||
There was a problem hiding this comment.
This should follow the pattern of having an accessor and a polling function for changes it should be updated to return Option<GiphRsError>
However, this introduces an issue as a stream's terminal state is indicated by a None value. We could get around it by adding a GiphRsError.None enum value
There was a problem hiding this comment.
I went ahead and created GiphRsErrorState to avoid having a None state in GiphRsError which based on research appears to be an anti-pattern. Updated iOS and Android with the new enum, was able to build on both now!!!!
Screen_recording_20260422_175329.webm
There was a problem hiding this comment.
…onfusion of None in stream being both no error or closed stream
Propagate errors from Rust to Swift via GiphRSError