Skip to content
Snippets Groups Projects
Commit 86cf046f authored by David Bühler's avatar David Bühler Committed by Maxime Jacquemin
Browse files

[ivette] Source code: catches errors on server request.

parent 04a80545
No related branches found
No related tags found
No related merge requests found
......@@ -105,9 +105,17 @@ export default function SourceCode() {
async function select(_: editor, pos?: position) {
if (file === '' || !pos) return;
const arg = [file, pos.line + 1, pos.ch + 1];
const [fct, marker] = await Server.send(getMarkerAt, arg);
if (fct || marker)
updateSelection({ location: { fct, marker } });
try {
const [fct, marker] = await Server.send(getMarkerAt, arg);
if (fct || marker)
updateSelection({ location: { fct, marker } });
} catch (err) {
D.error(`Failed to get marker from source file position: ${err}`);
Status.setMessage({
text: 'Failed request to Frama-C server',
kind: 'error',
});
}
}
const [command] = Settings.useGlobalSettings(Preferences.EditorCommand);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment