BingAds / BingAds-Python-SDK

Other
116 stars 162 forks source link

Typo in util function errorcode_of_exception #126

Closed SStembridge closed 5 years ago

SStembridge commented 5 years ago

I'm not familiar with creating pull requests and it's a simple typo so I'd like to point it out here. https://github.com/BingAds/BingAds-Python-SDK/blob/master/bingads/util.py line 60

    def errorcode_of_exception(ex):
        if isinstance(ex, WebFault):
            if hasattr(ex.fault, 'detail') \
                    and hasattr(ex.fault.detail, 'AdApiFaultDetail') \
                    and hasattr(ex.fault.detail.AdApiFaultDetail, 'Errors') \
                    and hasattr(ex.fault.detail.AdApiFaultDetail.Errors, 'AdApiError'):
                ad_api_errors = ex.fault.detail.AdApiFaultDetail.Errors.AdApiError
                if type(ad_api_errors) == list:
==>                return ad_api_erros[0].Code
                else:
                    return ad_api_errors.Code
        return -1

ad_api_erros[0] should be ad_api_errors[0]

qitia commented 5 years ago

thanks @SStembridge. Will update it soon.

eric-urban commented 5 years ago

@SStembridge this is resolved via release 12.13.3.1. Thanks for the catch!

@qitia thanks for the quick update!