Sometimes due to connectivity issues etc. Xendit APIs can return error responses that do not conform to XenditError standard (aka not have the error_code), or it may not even be a valid JSON (e.g. error from Nginx Gateway which is in HTML format). However, some of the APIs may map the http error from the API to the XenditError object, and since it does not have the error_code field it results in an exception that error_code does not exist. This obscures the user from the actual error they encounter. This needs to be
An example of it can be seen below:
