Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-warehouse): surface the real error behind 'Failed to retrieve types for view' (#69747)

George Munyoro589b56b52776
diff --git a/products/data_warehouse/backend/presentation/views/saved_query.py b/products/data_warehouse/backend/presentation/views/saved_query.py
index 116ea6293ce4..f654160f22d4 100644
--- a/products/data_warehouse/backend/presentation/views/saved_query.py
+++ b/products/data_warehouse/backend/presentation/views/saved_query.py
@@ -453,7 +453,9 @@ class DataWarehouseSavedQuerySerializer(
view.columns = columns
view.external_tables = view.s3_tables
- except Exception:
+ except Exception as e:
+ capture_exception(e)
+ logger.exception("Failed to retrieve types for view %s", view.name)
raise serializers.ValidationError("Failed to retrieve types for view")
with transaction.atomic():
@@ -594,7 +596,9 @@ class DataWarehouseSavedQuerySerializer(
view.external_tables = view.s3_tables
except RecursionError:
raise serializers.ValidationError("Model contains a cycle")
- except Exception:
+ except Exception as e:
+ capture_exception(e)
+ logger.exception("Failed to retrieve types for view %s", view.name)
raise serializers.ValidationError("Failed to retrieve types for view")
view.status = DataWarehouseSavedQuery.Status.MODIFIED