Skip to content

Commit b92b845

Browse files
fix
1 parent 43e68fa commit b92b845

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

packages/postgres-database/src/simcore_postgres_database/utils_projects.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
import uuid
12
from datetime import datetime, timezone
23

34
import sqlalchemy as sa
4-
from models_library.errors_classes import OsparcErrorMixin
5-
from models_library.projects import ProjectID
65
from pydantic import parse_obj_as
6+
from pydantic.errors import PydanticErrorMixin
77
from sqlalchemy.ext.asyncio import AsyncConnection
88

99
from .models.projects import projects
1010
from .utils_repos import transaction_context
1111

1212

13-
class DBBaseProjectError(OsparcErrorMixin, Exception):
14-
...
13+
class DBBaseProjectError(PydanticErrorMixin, Exception):
14+
msg_template: str = "Project utils unexpected error"
1515

1616

1717
class DBProjectNotFoundError(DBBaseProjectError):
18-
project_uuid: ProjectID
18+
msg_template: str = "Project project_uuid={project_uuid!r} not found"
1919

2020

2121
class ProjectsRepo:
@@ -24,7 +24,7 @@ def __init__(self, engine):
2424

2525
async def get_project_last_change_date(
2626
self,
27-
project_uuid: ProjectID,
27+
project_uuid: uuid.UUID,
2828
*,
2929
connection: AsyncConnection | None = None,
3030
) -> datetime:

services/efs-guardian/src/simcore_service_efs_guardian/services/efs_manager.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,16 @@ async def remove_project_efs_data(self, project_id: ProjectID) -> None:
131131
shutil.rmtree(_dir_path)
132132
_logger.info("%s has been deleted.", _dir_path)
133133
except FileNotFoundError as e:
134-
_logger.error("Directory %s does not exist.", _dir_path)
134+
_logger.error("Directory %s does not exist. Error: %s", _dir_path, e)
135135
except PermissionError as e:
136-
_logger.error("Permission denied when trying to delete %s.", _dir_path)
136+
_logger.error(
137+
"Permission denied when trying to delete %s. Error: %s",
138+
_dir_path,
139+
e,
140+
)
137141
except NotADirectoryError as e:
138-
_logger.error("%s is not a directory.", _dir_path)
142+
_logger.error("%s is not a directory. Error: %s", _dir_path, e)
139143
except OSError as e:
140-
_logger.error("Error: %s. Issue with path: %s", e, _dir_path)
144+
_logger.error("Issue with path: %s Error: %s", _dir_path, e)
141145
else:
142146
_logger.error("%s does not exist.", _dir_path)

0 commit comments

Comments
 (0)