Skip to content

Commit

Permalink
stop surpressing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Sep 22, 2024
1 parent 1c336f6 commit 03fb112
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions linguaphoto/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ async def __aenter__(self) -> Self:
return self

async def __aexit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> bool | None:
self,
exc_type: type[BaseException] | None,
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None:
# Check if exc_type is None before using issubclass
exception_type = exc_type if exc_type is not None and issubclass(exc_type, Exception) else None
exception_value = exc_value if isinstance(exc_value, Exception) else None
Expand All @@ -76,8 +79,6 @@ async def __aexit__(
if self.__s3:
await self.__s3.__aexit__(exception_type, exception_value, traceback)

return True

def _validate_item(self, data: dict[str, Any], item_class: type[T]) -> T:
if (item_type := data.pop("type")) != item_class.__name__:
raise InternalError(f"Item type {str(item_type)} is not a {item_class.__name__}")
Expand Down

0 comments on commit 03fb112

Please sign in to comment.