Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Dec 24, 2024
1 parent 74eba58 commit e522957
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/phoenix/server/api/mutations/prompt_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import strawberry
from pydantic import ValidationError
from sqlean.dbapi2 import IntegrityError # type: ignore[import-untyped]
from sqlalchemy.exc import IntegrityError as PostgresIntegrityError
from sqlean.dbapi2 import IntegrityError as SQLiteIntegrityError # type: ignore[import-untyped]
from strawberry.types import Info

from phoenix.db import models
Expand Down Expand Up @@ -47,6 +48,6 @@ async def create_prompt(self, info: Info[Context, None], input: CreatePromptInpu
session.add(prompt)
try:
await session.commit()
except IntegrityError:
except (PostgresIntegrityError, SQLiteIntegrityError):
raise Conflict(f"A prompt named '{input.name}' already exists")
return to_gql_prompt(prompt)

0 comments on commit e522957

Please sign in to comment.