Exception raised when a requested resource is not found.
| 39 | |
| 40 | |
| 41 | class ResourceNotFoundError(AWSServiceError): |
| 42 | """Exception raised when a requested resource is not found.""" |
| 43 | |
| 44 | def __init__(self, message: str, resource_type: Optional[str] = None, resource_id: Optional[str] = None): |
| 45 | """ |
| 46 | Initialize the resource not found error. |
| 47 | |
| 48 | Args: |
| 49 | message: Error message |
| 50 | resource_type: Type of resource that was not found |
| 51 | resource_id: ID of the resource that was not found |
| 52 | """ |
| 53 | suggestion = None |
| 54 | if resource_type and resource_id: |
| 55 | suggestion = f"Check if the {resource_type} '{resource_id}' exists and you have permission to access it." |
| 56 | elif resource_type: |
| 57 | suggestion = f"Check if the {resource_type} exists and you have permission to access it." |
| 58 | |
| 59 | super().__init__(message, suggestion) |
| 60 | self.resource_type = resource_type |
| 61 | self.resource_id = resource_id |
| 62 | |
| 63 | |
| 64 | class PermissionDeniedError(AWSServiceError): |
no outgoing calls