How to use the aliyun-python-sdk-core-v3.aliyunsdkcore.acs_exception.exceptions.ClientException function in aliyun-python-sdk-core-v3

To help you get started, we’ve selected a few aliyun-python-sdk-core-v3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core-v3 / aliyunsdkcore / profile / location_service.py View on Github external
if len(endpoint) <= 0:
                    return None
                else:
                    return endpoint[0].get('Endpoint')
            elif 400 <= status < 500:
                # print "serviceCode=" + service_code + " get location error!
                # code=" + result.get('Code') +", message =" +
                # result.get('Message')
                return None
            elif status >= 500:
                # return None instead of throw an exception
                # in case of location service failure
                # SDK still has to work for robustness
                return None
            else:
                raise exs.ClientException(
                    result.get('Code'), result.get('Message'))
        except IOError:
            # return None instead of throw an exception
            # in case of location service unreachable,
            # SDK still has to work for robustness
            return None
        except AttributeError:
            raise exs.ClientException(
                error_code.SDK_INVALID_REQUEST,
                error_msg.get_msg('SDK_INVALID_REQUEST'))
github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core-v3 / aliyunsdkcore / profile / location_service.py View on Github external
return None
            elif status >= 500:
                # return None instead of throw an exception
                # in case of location service failure
                # SDK still has to work for robustness
                return None
            else:
                raise exs.ClientException(
                    result.get('Code'), result.get('Message'))
        except IOError:
            # return None instead of throw an exception
            # in case of location service unreachable,
            # SDK still has to work for robustness
            return None
        except AttributeError:
            raise exs.ClientException(
                error_code.SDK_INVALID_REQUEST,
                error_msg.get_msg('SDK_INVALID_REQUEST'))

aliyun-python-sdk-core-v3

The core module of Aliyun Python SDK.

Apache-2.0
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis

Similar packages