|
16 | 16 | from sphinxcontrib.confluencebuilder.exceptions import ConfluencePermissionError |
17 | 17 | from sphinxcontrib.confluencebuilder.exceptions import ConfluencePublishAncestorError |
18 | 18 | from sphinxcontrib.confluencebuilder.exceptions import ConfluencePublishSelfAncestorError |
| 19 | +from sphinxcontrib.confluencebuilder.exceptions import ConfluenceUnexpectedCdataError |
19 | 20 | from sphinxcontrib.confluencebuilder.exceptions import ConfluenceUnreconciledPageError |
20 | 21 | from sphinxcontrib.confluencebuilder.logger import ConfluenceLogger as logger |
21 | 22 | from sphinxcontrib.confluencebuilder.rest import Rest |
@@ -922,6 +923,9 @@ def store_page(self, page_name, data, parent_id=None): |
922 | 923 | self.rest_client.post(url, labels) |
923 | 924 |
|
924 | 925 | except ConfluenceBadApiError as ex: |
| 926 | + if str(ex).find('CDATA block has embedded') != -1: |
| 927 | + raise ConfluenceUnexpectedCdataError from ex |
| 928 | + |
925 | 929 | # Check if Confluence reports that the new page request |
926 | 930 | # fails, indicating it already exists. This is usually |
927 | 931 | # (outside of possible permission use cases) that the page |
@@ -1235,6 +1239,8 @@ def _update_page(self, page, page_name, data, parent_id=None): |
1235 | 1239 | try: |
1236 | 1240 | self.rest_client.put('content', page_id_explicit, update_page) |
1237 | 1241 | except ConfluenceBadApiError as ex: |
| 1242 | + if str(ex).find('CDATA block has embedded') != -1: |
| 1243 | + raise ConfluenceUnexpectedCdataError from ex |
1238 | 1244 |
|
1239 | 1245 | # Handle select API failures by waiting a moment and retrying the |
1240 | 1246 | # content request. If it happens again, the put request will fail as |
|
0 commit comments