Open OWissett opened 1 year ago
Often freesasa C-api will return different error return codes, these should be reflected in the errors (which can't be done with static string errors)
E.g.
if res_code == freesasa_error_codes_FREESASA_SUCCESS {
Ok(())
} else {
Err("Failed to add atom to structure") // Here we should return a more useful error message
}
I have started on this on the branch ow/errors
I have implemented a custom Error type which can provide better context and error handling
Right now, the library typically returns a static string for the error type because it is easy.
The issue is that this is not very descriptive.
We should implement our own Error types or change over to
anyhow
errors, which can provide improved usage.