From 7fcbf01729b70787a1a857e56a3fef5a4fcb7524 Mon Sep 17 00:00:00 2001 From: hitenvidhani Date: Sat, 4 May 2024 16:48:00 +0530 Subject: [PATCH] Init --- mathesar/api/db/viewsets/tables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mathesar/api/db/viewsets/tables.py b/mathesar/api/db/viewsets/tables.py index 635ab234d4..a6c15206a2 100644 --- a/mathesar/api/db/viewsets/tables.py +++ b/mathesar/api/db/viewsets/tables.py @@ -7,7 +7,7 @@ from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin from rest_framework.response import Response from rest_framework.permissions import IsAuthenticatedOrReadOnly -from sqlalchemy.exc import DataError, IntegrityError, ProgrammingError +from sqlalchemy.exc import DataError, IntegrityError, ProgrammingError, InternalError from db.types.exceptions import UnsupportedTypeException from db.columns.exceptions import NotNullError, ForeignKeyError, TypeMismatchError, UniqueValueError, ExclusionError, ColumnMappingsNotFound @@ -154,7 +154,7 @@ def previews(self, request, pk=None): table_data = TableSerializer(table, context={"request": request}).data try: preview_records = table.get_preview(columns) - except (DataError, IntegrityError) as e: + except (DataError, IntegrityError, InternalError) as e: if type(e.orig) is InvalidTextRepresentation or type(e.orig) is CheckViolation: raise database_api_exceptions.InvalidTypeCastAPIException( e,