Skip to content

Error propagation UI#4

Open
estebanuribe wants to merge 3 commits intopull-refreshfrom
error-propagation-ui
Open

Error propagation UI#4
estebanuribe wants to merge 3 commits intopull-refreshfrom
error-propagation-ui

Conversation

@estebanuribe
Copy link
Copy Markdown
Collaborator

Propagate errors from Rust to Swift via GiphRSError

/**
* Converts a GiphRsError to a standard Kotlin Exception
*/
fun GiphRsError.toException(): Exception {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets translated by UniFFI to GiphRsException which is an Exception

@@ -53,7 +54,7 @@ impl RustViewModel {
}

pub fn has_error(&self) -> bool {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants