Commit bb839d7
committed
Add HTTP status context to XML parsing error messages
Enhanced ResponseParserError messages to include HTTP status codes and
messages when XML parsing fails, providing better debugging context for
users while maintaining full backward compatibility.
Changes:
- Modified QueryParser._do_error_parse() to append HTTP status context
- Modified RestXMLParser._parse_error_from_body() to append HTTP status context
- Enhanced error messages format: "original error (HTTP 413: Content Too Large)"
- Preserves original ResponseParserError exception type for compatibility
- Added comprehensive tests for both parser classes
- Tests handle Python version differences in HTTP status messages1 parent 6d3a89f commit bb839d7
File tree
3 files changed
+32
-18
lines changed- botocore
- tests/unit
3 files changed
+32
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
603 | 605 | | |
604 | 606 | | |
605 | 607 | | |
| |||
1458 | 1460 | | |
1459 | 1461 | | |
1460 | 1462 | | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1466 | 1469 | | |
1467 | 1470 | | |
1468 | 1471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
1644 | 1647 | | |
1645 | 1648 | | |
1646 | 1649 | | |
| |||
1658 | 1661 | | |
1659 | 1662 | | |
1660 | 1663 | | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | | - | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
1665 | 1671 | | |
1666 | 1672 | | |
1667 | 1673 | | |
| |||
0 commit comments