From 9d2f222293942109e30ddc802626249630d026d6 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Sat, 10 Feb 2024 23:37:09 -0800 Subject: [PATCH] Use a try-catch around get_help_text See discussion in #283. Completely untested so far. --- inst/private/doctest_collect.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inst/private/doctest_collect.m b/inst/private/doctest_collect.m index 0415e06..98a700c 100644 --- a/inst/private/doctest_collect.m +++ b/inst/private/doctest_collect.m @@ -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 @@ -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')