Skip to content

Commit 8cc7503

Browse files
committed
chore: small improvement to lsp error messaging
1 parent 2d87813 commit 8cc7503

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sqlmesh/lsp/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ def ensure_context_for_document(self, document: TextDocument) -> TextDocument:
9595
for ext in ("py", "yml", "yaml"):
9696
config_path = path / f"config.{ext}"
9797
if config_path.exists():
98-
with suppress(Exception):
98+
try:
9999
# Use user-provided instantiator to build the context
100100
self.context = self.context_class(paths=[path])
101101
self.server.show_message(f"Context loaded for: {path}")
102102
loaded = True
103103
# Re-check context for document now that it's loaded
104104
return self.ensure_context_for_document(document)
105+
except Exception as e:
106+
self.server.show_message(f"Error loading context: {e}", types.MessageType.Error)
105107
path = path.parent
106108

107109
return document

0 commit comments

Comments
 (0)