diff --git a/ivette/src/frama-c/kernel/SourceCode.tsx b/ivette/src/frama-c/kernel/SourceCode.tsx index 3dbeef14f1a3a10dfe68690c296d0b7bce3d4c92..c9f3d9e0d40be9516be94959d8889852722c326d 100644 --- a/ivette/src/frama-c/kernel/SourceCode.tsx +++ b/ivette/src/frama-c/kernel/SourceCode.tsx @@ -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);