Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1 

2""" Exceptions for working with SDC Data Schemas """ 

3 

4 

5class DataSchemaNotFound(Exception): 

6 """ 

7 Custom exception class. Data schema was not found. 

8 """ 

9 

10 

11class DataSchemaEndpointTagNotFound(Exception): 

12 """ 

13 Custom exception class. Given endpoint tag was not found in data schema. 

14 """ 

15 

16 

17class DataSchemaCriticalError(Exception): 

18 """ 

19 Custom exception class. Critical error that prevents validation from running. 

20 """ 

21 

22 

23class InvalidSchemaCredentialsType(Exception): 

24 """ 

25 Custom exception class. Invalid credentials type given. 

26 """ 

27 

28 def __init__(self, credentials_type_): 

29 self.message = f"'{credentials_type_}' is not a valid credentials type." 

30 super().__init__(self.message) 

31 

32 

33class DataSchemaFailedValidation(Exception): 

34 """ 

35 Custom exception class. Data schema failed validation. 

36 """ 

37 

38 def __init__(self, ttl_errors_): 

39 self.message = f"Schema Validation has failed with {ttl_errors_:,} error(s)." 

40 super().__init__(self.message)