Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Error handling #1

Open
Gers2017 opened this issue Oct 18, 2022 · 0 comments
Open

Better Error handling #1

Gers2017 opened this issue Oct 18, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed low priority Not a critical feature/bug

Comments

@Gers2017
Copy link
Owner

Return Error instead of String to the user

async fn send_to_node(&self, json: &str) -> Result<String, String> {
                                                             ^----
 /// ...
  let operation_result = serde_json::from_str(json);

  let operation: PlainOperation = match operation_result {
    Ok(op) => op,
    Err(err) => return Err(err.to_string()),
                                ^----
  };
}
@Gers2017 Gers2017 added enhancement New feature or request help wanted Extra attention is needed low priority Not a critical feature/bug labels Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed low priority Not a critical feature/bug
Projects
None yet
Development

No branches or pull requests

1 participant