Skip to content

Commit

Permalink
Refine
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca committed Sep 27, 2022
1 parent 04a2b7a commit a230940
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/api/datasets/routes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

from fastapi import APIRouter, Depends
from fastapi.exceptions import HTTPException
from starlette.responses import Response
Expand All @@ -24,6 +26,8 @@
from . import filters
from .schemas import DatasetCreate, DatasetListParams, DatasetUpdate

logger = logging.getLogger(__name__)

router = APIRouter(prefix="/datasets", tags=["datasets"])

router.include_router(filters.router)
Expand Down Expand Up @@ -89,7 +93,8 @@ async def create_dataset(data: DatasetCreate, request: "APIRequest") -> DatasetV
id = await bus.execute(command)
except CatalogDoesNotExist as exc:
raise HTTPException(400, detail=str(exc))
except CannotCreateDataset:
except CannotCreateDataset as exc:
logger.exception(exc)
raise HTTPException(403, detail="Permission denied")

query = GetDatasetByID(id=id)
Expand Down

0 comments on commit a230940

Please sign in to comment.