How to use the uiautomator2.exceptions.BaseError function in uiautomator2

To help you get started, we’ve selected a few uiautomator2 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 openatx / uiautomator2 / uiautomator2 / __init__.py View on Github external
"mainActivity": "com.github.uiautomator.MainActivity",
                "label": "ATX",
                "versionName": "1.1.7",
                "versionCode": 1001007,
                "size":1760809
            }

        Raises:
            UiaError
        """
        url = self.path2url('/packages/{0}/info'.format(pkg_name))
        resp = self._reqsess.get(url)
        resp.raise_for_status()
        resp = resp.json()
        if not resp.get('success'):
            raise BaseError(resp.get('description', 'unknown'))
        return resp.get('data')
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
import json


class BaseError(Exception):
    pass


class RetryError(BaseError):
    """ retry when meet this error """


class SessionBrokenError(BaseError):
    """ only happens when app quit or crash """


class UiautomatorQuitError(BaseError):
    pass


class ConnectError(BaseError):
    pass


class XPathElementNotFoundError(BaseError):
    pass


class GatewayError(BaseError):
    def __init__(self, response, description):
        self.response = response
        self.description = description
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
class XPathElementNotFoundError(BaseError):
    pass


class GatewayError(BaseError):
    def __init__(self, response, description):
        self.response = response
        self.description = description

    def __str__(self):
        return "uiautomator2.GatewayError(" + self.description + ")"


class JsonRpcError(BaseError):
    @staticmethod
    def format_errcode(errcode):
        m = {
            -32700: 'Parse error',
            -32600: 'Invalid Request',
            -32601: 'Method not found',
            -32602: 'Invalid params',
            -32603: 'Internal error',
            -32001: 'Jsonrpc error',
            -32002: 'Client error',
        }
        if errcode in m:
            return m[errcode]
        if errcode >= -32099 and errcode <= -32000:
            return 'Server error'
        return 'Unknown error'
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
# coding: utf-8
#

# class ATXError(Exception):
#     pass

import json


class BaseError(Exception):
    pass


class RetryError(BaseError):
    """ retry when meet this error """


class SessionBrokenError(BaseError):
    """ only happens when app quit or crash """


class UiautomatorQuitError(BaseError):
    pass


class ConnectError(BaseError):
    pass


class XPathElementNotFoundError(BaseError):
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
""" only happens when app quit or crash """


class UiautomatorQuitError(BaseError):
    pass


class ConnectError(BaseError):
    pass


class XPathElementNotFoundError(BaseError):
    pass


class GatewayError(BaseError):
    def __init__(self, response, description):
        self.response = response
        self.description = description

    def __str__(self):
        return "uiautomator2.GatewayError(" + self.description + ")"


class JsonRpcError(BaseError):
    @staticmethod
    def format_errcode(errcode):
        m = {
            -32700: 'Parse error',
            -32600: 'Invalid Request',
            -32601: 'Method not found',
            -32602: 'Invalid params',
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
# class ATXError(Exception):
#     pass

import json


class BaseError(Exception):
    pass


class RetryError(BaseError):
    """ retry when meet this error """


class SessionBrokenError(BaseError):
    """ only happens when app quit or crash """


class UiautomatorQuitError(BaseError):
    pass


class ConnectError(BaseError):
    pass


class XPathElementNotFoundError(BaseError):
    pass


class GatewayError(BaseError):
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
pass


class RetryError(BaseError):
    """ retry when meet this error """


class SessionBrokenError(BaseError):
    """ only happens when app quit or crash """


class UiautomatorQuitError(BaseError):
    pass


class ConnectError(BaseError):
    pass


class XPathElementNotFoundError(BaseError):
    pass


class GatewayError(BaseError):
    def __init__(self, response, description):
        self.response = response
        self.description = description

    def __str__(self):
        return "uiautomator2.GatewayError(" + self.description + ")"
github openatx / uiautomator2 / uiautomator2 / exceptions.py View on Github external
""" retry when meet this error """


class SessionBrokenError(BaseError):
    """ only happens when app quit or crash """


class UiautomatorQuitError(BaseError):
    pass


class ConnectError(BaseError):
    pass


class XPathElementNotFoundError(BaseError):
    pass


class GatewayError(BaseError):
    def __init__(self, response, description):
        self.response = response
        self.description = description

    def __str__(self):
        return "uiautomator2.GatewayError(" + self.description + ")"


class JsonRpcError(BaseError):
    @staticmethod
    def format_errcode(errcode):
        m = {