Skip to content

Commit f8cb770

Browse files
committed
fix(analyzer): better exception message for invalid command variable files
1 parent b43520d commit f8cb770

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/robot/src/robotcode/robot/diagnostics/document_cache_helper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ def get_languages_for_document(self, document_or_uri: Union[TextDocument, Uri, s
118118
except ValueError as e:
119119
ex = e
120120
self._logger.exception(
121-
lambda: f"Language configuration is not valid: {ex}"
122-
"\nPlease check your 'robotcode.robot.language' configuration.",
121+
lambda: f"Language configuration is not valid: {ex}",
123122
exc_info=ex,
124123
level=CRITICAL,
125124
)

packages/robot/src/robotcode/robot/diagnostics/imports_manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,11 @@ def get_command_line_variables(self) -> List[VariableDefinition]:
663663
raise
664664
except BaseException as e:
665665
# TODO add diagnostics
666-
self._logger.exception(e)
666+
ex = e
667+
self._logger.exception(
668+
lambda: f"Error getting command line variables: {ex}",
669+
exc_info=ex,
670+
)
667671

668672
self._command_line_variables = command_line_vars
669673

tests/robotcode/language_server/robotframework/parts/data/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@
4848
"editor.quickSuggestions": {
4949
"strings": "on"
5050
}
51-
},"
51+
}
5252
}

0 commit comments

Comments
 (0)