Closed yursan9 closed 2 years ago
@yursan9 thank you for reaching out to us. Could you help to elaborate more details or give us a simple sample code? So we can get more details about your concern. Thank you
I usually wrap 3rd party call on our own function, I want to be able to wrap and persist midtrans.Error
if I bubble up the error
func SnapRequest(...) error {
req := &snap.Request{...}
resp, err := snapClient.CreateTransaction(req)
if err != nil {
return fmt.Errorf("Error on calling Create Transaction: %w.", err)
}
return nil
}
I want to be able using errors.Is
and errors.As
to checks if error is on calling midtrans API or on other process. What I want is for you to make midtrans.Error
implement modern error value; https://go.dev/blog/go1.13-errors
Hi, @yursan9 this seems like enhancement/changes that need to be further checked & tested to ensure proper compatibility, also to avoid breaking changes. Will take a look at this. But unfortunately, we still don't have any ETA yet. Otherwise, if you have already tried on your side and have the changes. Feel free to submit a pull request.
Thank you
I guess I'll try to submit the PR later
Hi, @yursan9 this request is already on the new version, if you have any questions please create a new one. Thank you
Can you guys add Error method to
midtrans.Error
so it's compatible with standarderrors
package?