forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit811b6e3
committed
Rework error messages around file handling
Some error messages related to file handling are using the code pathcontext to define their state. For example, 2PC-related errors arereferring to "two-phase status files", or "relation mapping file" isused for catalog-to-filenode mapping, however those prove to bedifficult to translate, and are not more helpful than just referring tothe path of the file being worked on. So simplify all those errormessages by just referring to files with their path used. In somecases, like the manipulation of WAL segments, the context is actuallyhelpful so those are kept.Calls to the system function read() have also been rather inconsistentwith their error handling sometimes not reporting the number of bytesread, and some other code paths trying to use an errno which has notbeen set. The in-core functions are using a more consistent patternwith this patch, which checks for both errno if set or if aninconsistent read is happening.So as to care about pluralization when reading an unexpected number ofbyte(s), "could not read: read %d of %zu" is used as error message, with%d field being the output result of read() and %zu the expected size.This simplifies the work of translators with less variations of the samemessage.Author: Michael PaquierReviewed-by: Álvaro HerreraDiscussion:https://postgr.es/m/20180520000522.GB1603@paquier.xyz1 parentc6736ff commit811b6e3
File tree
12 files changed
+207
-95
lines changed- src
- backend
- access/transam
- replication
- logical
- utils/cache
- bin
- pg_basebackup
- pg_rewind
- pg_waldump
- common
12 files changed
+207
-95
lines changedLines changed: 22 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1219 | 1219 |
| |
1220 | 1220 |
| |
1221 | 1221 |
| |
| 1222 | + | |
1222 | 1223 |
| |
1223 | 1224 |
| |
1224 | 1225 |
| |
| |||
1228 | 1229 |
| |
1229 | 1230 |
| |
1230 | 1231 |
| |
1231 |
| - | |
1232 |
| - | |
| 1232 | + | |
1233 | 1233 |
| |
1234 | 1234 |
| |
1235 | 1235 |
| |
| |||
1249 | 1249 |
| |
1250 | 1250 |
| |
1251 | 1251 |
| |
1252 |
| - | |
1253 |
| - | |
| 1252 | + | |
1254 | 1253 |
| |
1255 | 1254 |
| |
1256 | 1255 |
| |
| |||
1277 | 1276 |
| |
1278 | 1277 |
| |
1279 | 1278 |
| |
1280 |
| - | |
| 1279 | + | |
| 1280 | + | |
1281 | 1281 |
| |
1282 | 1282 |
| |
1283 | 1283 |
| |
1284 | 1284 |
| |
1285 | 1285 |
| |
1286 | 1286 |
| |
1287 | 1287 |
| |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
1292 |
| - | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1293 | 1299 |
| |
1294 | 1300 |
| |
1295 | 1301 |
| |
| |||
1632 | 1638 |
| |
1633 | 1639 |
| |
1634 | 1640 |
| |
1635 |
| - | |
1636 |
| - | |
| 1641 | + | |
1637 | 1642 |
| |
1638 | 1643 |
| |
1639 | 1644 |
| |
| |||
1661 | 1666 |
| |
1662 | 1667 |
| |
1663 | 1668 |
| |
1664 |
| - | |
1665 |
| - | |
| 1669 | + | |
1666 | 1670 |
| |
1667 | 1671 |
| |
1668 | 1672 |
| |
| |||
1677 | 1681 |
| |
1678 | 1682 |
| |
1679 | 1683 |
| |
1680 |
| - | |
| 1684 | + | |
1681 | 1685 |
| |
1682 | 1686 |
| |
1683 | 1687 |
| |
| |||
1690 | 1694 |
| |
1691 | 1695 |
| |
1692 | 1696 |
| |
1693 |
| - | |
| 1697 | + | |
1694 | 1698 |
| |
1695 | 1699 |
| |
1696 | 1700 |
| |
| |||
1707 | 1711 |
| |
1708 | 1712 |
| |
1709 | 1713 |
| |
1710 |
| - | |
| 1714 | + | |
1711 | 1715 |
| |
1712 | 1716 |
| |
1713 | 1717 |
| |
1714 | 1718 |
| |
1715 | 1719 |
| |
1716 | 1720 |
| |
1717 |
| - | |
| 1721 | + | |
1718 | 1722 |
| |
1719 | 1723 |
| |
1720 | 1724 |
| |
|
Lines changed: 27 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3408 | 3408 |
| |
3409 | 3409 |
| |
3410 | 3410 |
| |
| 3411 | + | |
| 3412 | + | |
3411 | 3413 |
| |
3412 | 3414 |
| |
3413 | 3415 |
| |
3414 | 3416 |
| |
3415 |
| - | |
| 3417 | + | |
| 3418 | + | |
3416 | 3419 |
| |
3417 |
| - | |
| 3420 | + | |
3418 | 3421 |
| |
3419 | 3422 |
| |
3420 | 3423 |
| |
3421 | 3424 |
| |
3422 | 3425 |
| |
3423 | 3426 |
| |
3424 |
| - | |
3425 |
| - | |
| 3427 | + | |
| 3428 | + | |
3426 | 3429 |
| |
3427 | 3430 |
| |
3428 | 3431 |
| |
| |||
4544 | 4547 |
| |
4545 | 4548 |
| |
4546 | 4549 |
| |
4547 |
| - | |
| 4550 | + | |
4548 | 4551 |
| |
4549 | 4552 |
| |
4550 | 4553 |
| |
| |||
4554 | 4557 |
| |
4555 | 4558 |
| |
4556 | 4559 |
| |
4557 |
| - | |
| 4560 | + | |
| 4561 | + | |
4558 | 4562 |
| |
4559 | 4563 |
| |
4560 |
| - | |
| 4564 | + | |
| 4565 | + | |
4561 | 4566 |
| |
4562 | 4567 |
| |
4563 | 4568 |
| |
| |||
11689 | 11694 |
| |
11690 | 11695 |
| |
11691 | 11696 |
| |
| 11697 | + | |
11692 | 11698 |
| |
11693 | 11699 |
| |
11694 | 11700 |
| |
| |||
11782 | 11788 |
| |
11783 | 11789 |
| |
11784 | 11790 |
| |
11785 |
| - | |
| 11791 | + | |
| 11792 | + | |
11786 | 11793 |
| |
11787 | 11794 |
| |
11788 | 11795 |
| |
11789 | 11796 |
| |
11790 | 11797 |
| |
11791 | 11798 |
| |
11792 |
| - | |
11793 |
| - | |
11794 |
| - | |
11795 |
| - | |
11796 |
| - | |
| 11799 | + | |
| 11800 | + | |
| 11801 | + | |
| 11802 | + | |
| 11803 | + | |
| 11804 | + | |
| 11805 | + | |
| 11806 | + | |
| 11807 | + | |
| 11808 | + | |
| 11809 | + | |
| 11810 | + | |
11797 | 11811 |
| |
11798 | 11812 |
| |
11799 | 11813 |
| |
|
Lines changed: 10 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
712 | 712 |
| |
713 | 713 |
| |
714 | 714 |
| |
715 |
| - | |
716 |
| - | |
717 |
| - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
718 | 725 |
| |
719 | 726 |
| |
720 | 727 |
| |
|
Lines changed: 48 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1726 | 1726 |
| |
1727 | 1727 |
| |
1728 | 1728 |
| |
1729 |
| - | |
1730 |
| - | |
1731 |
| - | |
1732 |
| - | |
1733 |
| - | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
1734 | 1741 |
| |
1735 | 1742 |
| |
1736 | 1743 |
| |
| |||
1757 | 1764 |
| |
1758 | 1765 |
| |
1759 | 1766 |
| |
1760 |
| - | |
1761 |
| - | |
1762 |
| - | |
1763 |
| - | |
1764 |
| - | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1765 | 1779 |
| |
1766 | 1780 |
| |
1767 | 1781 |
| |
| |||
1777 | 1791 |
| |
1778 | 1792 |
| |
1779 | 1793 |
| |
1780 |
| - | |
1781 |
| - | |
1782 |
| - | |
1783 |
| - | |
1784 |
| - | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
1785 | 1806 |
| |
1786 | 1807 |
| |
1787 | 1808 |
| |
| |||
1796 | 1817 |
| |
1797 | 1818 |
| |
1798 | 1819 |
| |
1799 |
| - | |
1800 |
| - | |
1801 |
| - | |
1802 |
| - | |
1803 |
| - | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
1804 | 1832 |
| |
1805 | 1833 |
| |
1806 | 1834 |
| |
|
Lines changed: 17 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1414 | 1414 |
| |
1415 | 1415 |
| |
1416 | 1416 |
| |
1417 |
| - | |
1418 |
| - | |
1419 |
| - | |
1420 |
| - | |
1421 |
| - | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1422 | 1426 |
| |
1423 | 1427 |
| |
1424 | 1428 |
| |
| |||
1454 | 1458 |
| |
1455 | 1459 |
| |
1456 | 1460 |
| |
1457 |
| - | |
1458 |
| - | |
1459 |
| - | |
1460 |
| - | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1461 | 1469 |
| |
1462 | 1470 |
| |
1463 | 1471 |
| |
|
0 commit comments
Comments
(0)