Improve link from API calls to errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- c
- Domain
- computer-vision
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.
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)
- Dominant language
- C
- Stars
- 11.7k
- Forks
- 797
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 15
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.
More from libvips/libvips
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·