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

Make error codes available #14

Open
mgrand opened this issue Jan 17, 2022 · 0 comments
Open

Make error codes available #14

mgrand opened this issue Jan 17, 2022 · 0 comments

Comments

@mgrand
Copy link

mgrand commented Jan 17, 2022

Right now, the only way I see for a program calling the UnQLite wrapper to know the nature of an error is to compare the error string associated with the error with the string literals in UnQLite's error.rs. This seems unsafe.

The Custom struct that is returned for the error contains UnQLite's numeric error code and the ErrorKind enum variant that the wrapper assigned to it. However, even though the ErrorKind enum is public, the fields of the UnQLite struct are private and there is no way for the calling program to access this.

Please add methods to access the fields of a Custom struct:

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Custom {
    kind: ErrorKind,
    raw: i32,
}
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

No branches or pull requests

1 participant