texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/HTML.pm (run_stage_handlers)


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/HTML.pm (run_stage_handlers): error message only if $status > 0.
Date: Mon, 08 Aug 2022 07:39:37 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 42867f3dea * tp/Texinfo/Convert/HTML.pm (run_stage_handlers): error 
message only if $status > 0.
42867f3dea is described below

commit 42867f3dea2ad1878de7168803e49bb7b512b528
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Aug 8 13:39:11 2022 +0200

    * tp/Texinfo/Convert/HTML.pm (run_stage_handlers):
    error message only if $status > 0.
---
 ChangeLog                  |  5 +++++
 doc/customization_api.texi |  3 +++
 tp/TODO                    |  6 ++++++
 tp/Texinfo/Convert/HTML.pm | 13 +++++++++----
 4 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 741c4aaf80..02343c8e9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-08  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/HTML.pm (run_stage_handlers):
+       error message only if $status > 0.
+
 2022-08-08  Gavin Smith  <gavinsmith0123@gmail.com>
 
        \newenvironment for preformatted
diff --git a/doc/customization_api.texi b/doc/customization_api.texi
index f2da3e3078..5d70f0b561 100644
--- a/doc/customization_api.texi
+++ b/doc/customization_api.texi
@@ -1849,6 +1849,9 @@ The call of the user defined functions is:
 tree root element. @var{$stage} is the current stage.
 
 If @var{$status} is not 0 it means that an error occured.
+If @var{$status} is positive, the user defined functions should
+have registered an error message.  If @var{$status} is negative,
+the converter will emit a non specific error message.
 @end deftypefn
 
 
diff --git a/tp/TODO b/tp/TODO
index ad4fdbebd7..44dffb4892 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -25,6 +25,12 @@ Bugs
 HTML API
 ========
 
+document in the API $converter->document_error, $converter->document_warn
+and link from stage_handler in Init File Calling at Different Stages
+to $converter->document_error explaining that when status is > 0,
+then it is likely that $converter->document_error should have been
+called in the stage_handler.
+
 document Texinfo::Config
 texinfo_register_init_loading_error
 texinfo_register_init_loading_warning
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 2b91baa358..693649fb9a 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -9323,12 +9323,17 @@ sub run_stage_handlers($$$)
       }
       my $status = &{$handler}($converter, $root, $stage);
       if ($status != 0) {
-        #if ($converter->get_conf('VERBOSE')) {
-        #  print STDERR "Handler $handler of $stage($priority) failed\n";
-        #}
-        $converter->document_error($converter,
+        if ($status < 0) {
+          $converter->document_error($converter,
              sprintf(__("handler %s of stage %s priority %s failed"),
                         $handler, $stage, $priority));
+        } else {
+          # the handler is supposed to have output an error message
+          # already if $status > 0
+          if ($self->get_conf('VERBOSE') or $self->get_conf('DEBUG')) {
+            print STDERR "Handler $handler of $stage($priority) failed\n";
+          }
+        }
         return $status;
       }
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]