Improve link from API calls to errors
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.7k
- Forks
- 797
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 15
Description
libvips API calls (eg. vips_image_new_from_file() or vips_add()) can fail and log error messages, but there is currently no reliable way to link an error message to a specific call.
Referring discussion: https://github.com/libvips/libvips/discussions/5009
Complications
- Errors can occur after the API call. For example
_new_from_file()can fail when the first pixel is decoded, which may not happen until much later. - Errors can occur before the API call. Results can come from the operation cache, and they might have errors from long before the API call that needs the result.
- Errors can be found in background workers, and they might be generating pixels for several top level functions.
- Errors in background threads can need to be passed to another thread for reporting.
Possible proposal?
- Have a parameter called
contextonVipsObjectthat holds an error buffer, and perhaps some other stuff. - When an error occurs, log a message on the context of the nearest object (an operation, an image, a region, a source, etc.).
- Use
vips_object_get_error(obj)to get an error message. This recursively walks the object and any associated objects (eg. down the image pipeline) and concatenates all the error buffers it finds.
(just a thought! maybe it wouldn't work)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referring discussion at https://github.com/libvips/libvips/discussions/5009, then inspect VipsObject and the existing error-handling paths. The proposal is not settled; done would require an agreed design that reliably links errors across delayed calls, cached results, background workers, and thread handoffs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- computer-vision
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100