8000 [ffi] Improve error handling for creating database · Issue #854 · ava-labs/firewood · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ffi] Improve error handling for creating database #854

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

Open
rkuris opened this issue Apr 21, 2025 · 4 comments
Open

[ffi] Improve error handling for creating database #854

rkuris opened this issue Apr 21, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@rkuris
Copy link
Collaborator
rkuris commented Apr 21, 2025

Currently, errors cause panics. We should figure out a way to map the rust errors into golang errors so that it doesn't just crash if something doesn't work right.

@rkuris rkuris added the enhancement New feature or request label Apr 21, 2025
@github-project-automation github-project-automation bot moved this to Backlog 🗄️ in avalanchego Apr 21, 2025
@rkuris
Copy link
Collaborator Author
rkuris commented Apr 28, 2025

We probably need to return a struct that has (return value, error) where the error is either a pointer to a string or nil.

@alarso16
Copy link
Contributor
alarso16 commented May 5, 2025

PR #860 uses the Value struct to pass characters in the byte array, but this is likely insufficient for comprehensive testing. There should be some way of identifying certain errors returned by Rust (example, key not found) and handling them appropriately in Go, either dropping the error value or for thorough testing. Additionally, no method of handling errors on fwd_open_db has been constructed yet.

@rkuris
Copy link
Collaborator Author
rkuris commented May 28, 2025

I think this is done, @alarso16 can you confirm?

@rkuris
Copy link
Collaborator Author
rkuris commented May 29, 2025

Only creating the database can panic at this point

@rkuris rkuris changed the title [ffi] Improve error handling for ffi layer [ffi] Improve error handling for creating database May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog 🧊
Development

No branches or pull requests

2 participants
0