kbcli GetInvoice return Text Consumer Error

49 views
Skip to first unread message

Jasson Liudy

unread,
Apr 5, 2022, 11:15:41 PM4/5/22
to Kill Bill users mailing-list
Hello,

I was trying to handle not found error when getting invoice but keep getting the same error messages

kbcli version: v2.3.0
Here is my implementation:

reqInvoiceDetail := &invoice.GetInvoiceParams{InvoiceID: invo.InvoiceId}
resInvoiceDetail, err := kb.Invoice.GetInvoice(invo.ctx, reqInvoiceDetail)

fmt.Println(err)
if err != nil {
    return nil, err
}
It prints out: 0xc000010d50 (**kbcommon.KillbillError) is not supported by the TextConsumer, can be resolved by supporting TextUnmarshaler interface

Pierre-Alexandre Meyer

unread,
Apr 6, 2022, 3:17:35 AM4/6/22
to Jasson Liudy, Kill Bill users mailing-list
Hi Jasson,

I had provided a workaround for https://github.com/go-swagger/go-swagger/issues/1929 in https://github.com/killbill/kbcli/pull/26 and had confirmed it works for 400 and 401 errors.

Are you saying it's not enough for 404?


--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/5dac657e-4ced-4ad9-a981-d5d98022d881n%40googlegroups.com.


--
Pierre

Jasson Liudy

unread,
Apr 6, 2022, 3:25:07 AM4/6/22
to Kill Bill users mailing-list
Yes, it does not explicitly told the invoice is not found. Because I found it inconsistent with other error, when getting Account through external key it explicitly return 404 in the error message. So I would like to handle all not found error by identifying the 404 in the error message.

Yes the workaround, does not handle 404 errors yet, I guess

Pierre-Alexandre Meyer

unread,
Apr 6, 2022, 5:02:44 AM4/6/22
to Jasson Liudy, Kill Bill users mailing-list
Thanks Jasson, I've created https://github.com/killbill/kbcli/issues/27 for tracking.



--
Pierre
Reply all
Reply to author
Forward
0 new messages