Skip to content

Commit

Permalink
Use a try-catch around get_help_text
Browse files Browse the repository at this point in the history
See discussion in #283.  Completely untested so far.
  • Loading branch information
cbm755 committed Feb 11, 2024
1 parent f35799a commit 9d2f222
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions inst/private/doctest_collect.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%%
% Copyright (c) 2010 Thomas Grenfell Smith
% Copyright (c) 2015 Michael Walter
% Copyright (c) 2015-2019, 2022-2023 Colin B. Macdonald
% Copyright (c) 2015-2019, 2022-2024 Colin B. Macdonald
% Copyright (c) 2015 Oliver Heimlich
% Copyright (C) 2018 Mike Miller
% SPDX-License-Identifier: BSD-3-Clause
Expand Down Expand Up @@ -364,7 +364,14 @@

function [docstring, error] = extract_docstring(name)
if is_octave()
[docstring, format] = get_help_text(name);
try
[docstring, format] = get_help_text (name);
catch exc
docstring = '';
error = strcat ('Error extracting help text: ', ...
doctest_format_exception (exc));
return
end
if strcmp(format, 'texinfo')
[docstring, error] = parse_texinfo(docstring);
elseif strcmp(format, 'plain text')
Expand Down

0 comments on commit 9d2f222

Please sign in to comment.