You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
Is there a reason for this restriction? I came across a use case where I would like to retry the operation upon failure, but since the internal f.err field is not nil, calling the same operation again would just return immediately with the existing error.
For example, when I call f.RegisterImageOptionsReader, I know the image type is either jpg or png and I am passing the correct mime type most of the time. Every once in a while, I pass in an incorrect mime type (eg. a png buffer with opts.ImageType set to jpg) and get an error. When this happens, I try to solve it by calling f.RegisterImageOptionsReader again with a different mime type (jpg in this case). However, f.RegisterImageOptionsReader returns with an error immediately because there is a previous error and I cannot overwrite it with nil.
SetErrordoes not allow users to overwrite the existing error with nil.fpdf/fpdf.go
Lines 291 to 295 in 504c6dd
Is there a reason for this restriction? I came across a use case where I would like to retry the operation upon failure, but since the internal f.err field is not nil, calling the same operation again would just return immediately with the existing error.
For example, when I call
f.RegisterImageOptionsReader, I know the image type is either jpg or png and I am passing the correct mime type most of the time. Every once in a while, I pass in an incorrect mime type (eg. a png buffer with opts.ImageType set to jpg) and get an error. When this happens, I try to solve it by callingf.RegisterImageOptionsReaderagain with a different mime type (jpg in this case). However,f.RegisterImageOptionsReaderreturns with an error immediately because there is a previous error and I cannot overwrite it with nil.fpdf/fpdf.go
Lines 3407 to 3411 in 504c6dd
I can help submit a PR for this if we decide to remove this restriction.