forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0873b2d
committed
libpq error message refactoring
libpq now contains a mix of error message strings that end withnewlines and don't end with newlines, due to some newer code pathswith new ways of passing errors around. This leads to confusion andmistakes both during development and translation.This adds new functions libpq_append_error() andlibpq_append_conn_error() that encapsulate common code paths forproducing error message strings. Notably, these functions append thenewline, so that the string appearing in the code does not end with anewline. This makes (almost) all error message strings in libpquniform in this regard (and also consistent with how we handle itoutside of libpq code). (There are a few exceptions that aredifficult to fit into this scheme, but they are only a few.)Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://www.postgresql.org/message-id/flat/7c0232ef-7b44-68db-599d-b327d0640a77@enterprisedb.com1 parentd627ce3 commit0873b2d
File tree
5 files changed
+79
-5
lines changed- src/interfaces/libpq
5 files changed
+79
-5
lines changedLines changed: 59 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1278 | 1278 |
| |
1279 | 1279 |
| |
1280 | 1280 |
| |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
887 | 887 |
| |
888 | 888 |
| |
889 | 889 |
| |
| 890 | + | |
| 891 | + | |
| 892 | + | |
890 | 893 |
| |
891 | 894 |
| |
892 | 895 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
5 |
| - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + |
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 |
| - | |
44 |
| - | |
45 | 43 |
| |
46 | 44 |
| |
47 | 45 |
| |
| |||
292 | 290 |
| |
293 | 291 |
| |
294 | 292 |
| |
295 |
| - | |
| 293 | + | |
296 | 294 |
| |
297 | 295 |
| |
298 | 296 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
160 | 170 |
| |
161 | 171 |
| |
162 | 172 |
| |
|
0 commit comments
Comments
(0)