Coverage for mindsdb / api / executor / exceptions.py: 100%

34 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1from mindsdb.api.mysql.mysql_proxy.libs.constants.mysql import ERR 

2 

3 

4# base exception for unknown error 

5class UnknownError(Exception): 

6 mysql_error_code = ERR.ER_UNKNOWN_ERROR 

7 is_expected = False 

8 

9 

10# base exception for known error 

11class ExecutorException(Exception): 

12 mysql_error_code = ERR.ER_UNKNOWN_ERROR 

13 is_expected = False 

14 

15 

16class NotSupportedYet(ExecutorException): 

17 mysql_error_code = ERR.ER_NOT_SUPPORTED_YET 

18 is_expected = True 

19 

20 

21class BadDbError(ExecutorException): 

22 mysql_error_code = ERR.ER_BAD_DB_ERROR 

23 is_expected = True 

24 

25 

26class BadTableError(ExecutorException): 

27 mysql_error_code = ERR.ER_BAD_DB_ERROR 

28 is_expected = True 

29 

30 

31class KeyColumnDoesNotExist(ExecutorException): 

32 mysql_error_code = ERR.ER_KEY_COLUMN_DOES_NOT_EXIST 

33 is_expected = True 

34 

35 

36class TableNotExistError(ExecutorException): 

37 mysql_error_code = ERR.ER_TABLE_EXISTS_ERROR 

38 is_expected = True 

39 

40 

41class WrongArgumentError(ExecutorException): 

42 mysql_error_code = ERR.ER_WRONG_ARGUMENTS 

43 is_expected = True 

44 

45 

46class LogicError(ExecutorException): 

47 mysql_error_code = ERR.ER_WRONG_USAGE 

48 is_expected = True 

49 

50 

51class SqlSyntaxError(ExecutorException): 

52 err_code = ERR.ER_SYNTAX_ERROR 

53 is_expected = True 

54 

55 

56class WrongCharsetError(ExecutorException): 

57 err_code = ERR.ER_UNKNOWN_CHARACTER_SET 

58 is_expected = True