diff --git a/src/dispatch/plugins/dispatch_aws/plugin.py b/src/dispatch/plugins/dispatch_aws/plugin.py index 96e858cf6ea3..9c120b01896d 100644 --- a/src/dispatch/plugins/dispatch_aws/plugin.py +++ b/src/dispatch/plugins/dispatch_aws/plugin.py @@ -94,7 +94,7 @@ def consume(self, db_session: Session, project: Project) -> None: ) except ValidationError as e: log.warning( - f"Received a signal instance that does not conform to the `SignalInstanceCreate` structure. Skipping creation: {e}" + f"Received a signal instance that does not conform to the SignalInstanceCreate pydantic model. Skipping creation: {e}" ) continue @@ -104,7 +104,7 @@ def consume(self, db_session: Session, project: Project) -> None: db_session=db_session, signal_instance_id=signal_instance_in.raw["id"] ): log.info( - f"Received a signal instance that already exists in the database. Skipping creation: {signal_instance_in.raw['id']}" + f"Received a signal that already exists in the database. Skipping signal instance creation: {signal_instance_in.raw['id']}" ) continue @@ -117,15 +117,17 @@ def consume(self, db_session: Session, project: Project) -> None: except IntegrityError as e: if isinstance(e.orig, UniqueViolation): log.info( - f"Received a signal instance that already exists in the database. Skipping creation: {e}" + f"Received a signal that already exists in the database. Skipping signal instance creation: {e}" ) else: log.exception( - f"Encountered an Integrity error when trying to create a signal instance: {e}" + f"Encountered an integrity error when trying to create a signal instance: {e}" ) continue except Exception as e: - log.exception(f"Unable to create signal instance: {e}") + log.exception( + f"Unable to create signal instance. Signal name/variant: {signal_instance_in.raw['name'] if signal_instance_in.raw and signal_instance_in.raw['name'] else signal_instance_in.raw['variant']}. Error: {e}" + ) db_session.rollback() continue else: diff --git a/src/dispatch/signal/service.py b/src/dispatch/signal/service.py index 18872ad48c58..6f5042c8371b 100644 --- a/src/dispatch/signal/service.py +++ b/src/dispatch/signal/service.py @@ -596,7 +596,7 @@ def create_instance( signal_instance.id = signal_instance_in.raw["id"] if signal_instance.id and not is_valid_uuid(signal_instance.id): - msg = f"Invalid signal id format. Expecting UUIDv4 format. Signal id: {signal_instance.id}. Signal name/variant: {signal_instance.signal.name if signal_instance.signal and signal_instance.signal.name else signal_instance.signal.variant}" + msg = f"Invalid signal id format. Expecting UUIDv4 format. Signal id: {signal_instance.id}. Signal name/variant: {signal_instance.signal.raw.name if signal_instance.signal and signal_instance.signal.raw and signal_instance.signal.raw.name else signal_instance.signal.raw.variant}" log.warn(msg) raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST,