Get the error message when a key fails the check. Args: key (Any): The key with wrong. Returns: str: The error message.
(cls, key: Any)
| 1366 | |
| 1367 | @classmethod |
| 1368 | def __get_key_error_msg__(cls, key: Any) -> str: |
| 1369 | """Get the error message when a key fails the check. |
| 1370 | |
| 1371 | Args: |
| 1372 | key (Any): |
| 1373 | The key with wrong. |
| 1374 | |
| 1375 | Returns: |
| 1376 | str: |
| 1377 | The error message. |
| 1378 | """ |
| 1379 | class_name = cls.__name__ |
| 1380 | absent_message = \ |
| 1381 | f'{key} is absent in' +\ |
| 1382 | f' {class_name}.SUPPORTED_KEYS.\n' |
| 1383 | suggestion_message = \ |
| 1384 | 'Call self.set_key_strict(False)' +\ |
| 1385 | ' to allow unsupported keys.\n' |
| 1386 | return absent_message + suggestion_message |
| 1387 | |
| 1388 | @classmethod |
| 1389 | def __get_value_error_msg__(cls) -> str: |