This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit c238a5cb990dd67f68672f46d7a5fd8a7d1fe4da
Author: Kamil BreguĊ‚a <[email protected]>
AuthorDate: Tue May 5 10:13:26 2020 +0200

    Carefully parse warning messages when building documentation (#8693)
    
    (cherry picked from commit 41b4c279619c4ad1a889918624a814469060921f)
---
 docs/build | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/docs/build b/docs/build
index f9856e9..72b0665 100755
--- a/docs/build
+++ b/docs/build
@@ -200,11 +200,19 @@ def parse_sphinx_warnings(warning_text: str) -> 
List[DocBuildError]:
             continue
         warning_parts = sphinx_warning.split(":", 2)
         if len(warning_parts) == 3:
-            sphinx_build_errors.append(
-                DocBuildError(
-                    file_path=warning_parts[0], line_no=int(warning_parts[1]), 
message=warning_parts[2]
+            try:
+                sphinx_build_errors.append(
+                    DocBuildError(
+                        file_path=warning_parts[0], 
line_no=int(warning_parts[1]), message=warning_parts[2]
+                    )
+                )
+            except Exception:  # pylint: disable=broad-except
+                # If an exception occurred while parsing the warning message, 
display the raw warning message.
+                sphinx_build_errors.append(
+                    DocBuildError(
+                        file_path=None, line_no=None, message=sphinx_warning
+                    )
                 )
-            )
         else:
             sphinx_build_errors.append(DocBuildError(file_path=None, 
line_no=None, message=sphinx_warning))
     return sphinx_build_errors

Reply via email to