mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
37 lines
776 B
Python
37 lines
776 B
Python
# -*- coding:utf-8 -*-
|
|
|
|
|
|
class BaseError(Exception):
|
|
_info = None
|
|
|
|
def __init__(self, ErrorInfo=None):
|
|
super().__init__(self) # 初始化父类
|
|
self._info = ErrorInfo or self._info
|
|
|
|
def __str__(self):
|
|
return self._info
|
|
|
|
|
|
class AlertExistsError(BaseError):
|
|
_info = '存在未处理的提示框。'
|
|
|
|
|
|
class ContextLossError(BaseError):
|
|
_info = '页面被刷新,请操作前尝试等待页面刷新或加载完成。'
|
|
|
|
|
|
class ElementLossError(BaseError):
|
|
_info = '该元素对象已不在当前页面中。'
|
|
|
|
|
|
class CallMethodError(BaseError):
|
|
_info = '方法调用错误。'
|
|
|
|
|
|
class TabClosedError(BaseError):
|
|
_info = '标签页已关闭。'
|
|
|
|
|
|
class NotElementFoundError(BaseError):
|
|
_info = '没有找到元素。'
|