-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Hi!
First of all, thanks for your work on this project. I've recently started using this crate for XML validation and when running tests with syntactically incorrect XML files (which might be the result from bad merges) I noticed that internal errors from libxml2
result in a panic.
I'm happy to contribute on this matter myself, I was just wondering which route you might want to take here. I've had a look at all the TODOs regarding error handling - turning the null-pointer checks in
https://github.com/KWARC/rust-libxml/blob/da4369a035557667650a221bc89d5e59d0efb247/src/schemas/parser.rs#L24C1-L26C6
from panics to results would necessitate either:
- making breaking API changes due to the changed return-type of the function
- to deprecate these functions and introduce new versions that support error handling
All the other occurrences of panics due to missing error-handling already return a Result<Self, Vec<StructuredError>>
, so implementing these should only be a matter of creating new StructuredError
s, i.e. StructuredError::null_ptr()
and StructuredError::internal()
.
Any and all feedback is appreciated!