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
Hey, I noticed an issue while I was trying to gracefully handle coupon errors. From what I can tell, there is not a good way to programmatically handle errors for specific fields. According to the documentation, I should be able to use the Param field on InvalidRequestException to determine the incorrect parameter, but from my experience, it has always been null. In the meantime, I am using ApiCode, however, it is deprecated.
- (ApiException) e {"Coupon INVALID_COUPON_TEST cannot be applied as it is not applicable to any of the items"} ChargeBee.Api.ApiException {ChargeBee.Exceptions.InvalidRequestException}
ApiCode "coupon_not_applicable" string
ApiErrorCode "invalid_request" string
ApiMessage "Coupon INVALID_COUPON_TEST cannot be applied as it is not applicable to any of the items" string
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
HResult -2146233088 int
HelpLink null string
HttpCode BadRequest System.Net.HttpStatusCode
HttpStatusCode BadRequest System.Net.HttpStatusCode
+ InnerException null System.Exception
Message "Coupon INVALID_COUPON_TEST cannot be applied as it is not applicable to any of the items" string
Param null string
Parameter null string
Source "ChargeBee" string
+ TargetSite {Void HandleException(System.Net.Http.HttpResponseMessage)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
Type "invalid_request" string
+ Static members
+ Non-Public members
The text was updated successfully, but these errors were encountered:
Hi @ecollis6 , I'm sorry about the delay in responding to this. Not all api error will have param field in the response. Please refer to Error Attribute section in the documentation. For those error with param in the response, we’ll be able to access it in the following way.
Hey, I noticed an issue while I was trying to gracefully handle coupon errors. From what I can tell, there is not a good way to programmatically handle errors for specific fields. According to the documentation, I should be able to use the
Param
field onInvalidRequestException
to determine the incorrect parameter, but from my experience, it has always beennull
. In the meantime, I am usingApiCode
, however, it is deprecated.The text was updated successfully, but these errors were encountered: