Skip to content

Commit 4b406a6

Browse files
committed
Use a try-catch around get_help_text
See discussion in #283. Completely untested so far.
1 parent eb9429f commit 4b406a6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

inst/private/doctest_collect.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
%%
1111
% Copyright (c) 2010 Thomas Grenfell Smith
1212
% Copyright (c) 2015 Michael Walter
13-
% Copyright (c) 2015-2019, 2022-2023 Colin B. Macdonald
13+
% Copyright (c) 2015-2019, 2022-2024 Colin B. Macdonald
1414
% Copyright (c) 2015 Oliver Heimlich
1515
% Copyright (C) 2018 Mike Miller
1616
% SPDX-License-Identifier: BSD-3-Clause
@@ -364,7 +364,14 @@
364364

365365
function [docstring, error] = extract_docstring(name)
366366
if is_octave()
367-
[docstring, format] = get_help_text(name);
367+
try
368+
[docstring, format] = get_help_text (name);
369+
catch exc
370+
docstring = '';
371+
error = strcat ('Error extracting help text: ', ...
372+
doctest_format_exception (exc));
373+
return
374+
end
368375
if strcmp(format, 'texinfo')
369376
[docstring, error] = parse_texinfo(docstring);
370377
elseif strcmp(format, 'plain text')

0 commit comments

Comments
 (0)