Commit b0e9ba2
fix(data-access): surface PG error details in logs and stop leaking credentials
#logAndThrowError was passing `this` (the entire BaseCollection instance
including JWT headers) as DataAccessError details, leaking credentials to
logs. PG error fields (code, message, details, hint) were never surfaced
in the log string — only visible in Coralogix deep serialization.
- Rewrite #logAndThrowError to read code/message/details/hint directly
from the PostgrestError cause and log a human-readable string
- Pass { entityName, tableName } instead of `this` as DataAccessError details
- Fix updateByKeys and batchGetByKeys to use #logAndThrowError for
consistent error logging instead of direct throw
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 355f09c commit b0e9ba2
File tree
2 files changed
+28
-15
lines changed2 files changed
+28
-15
lines changedLines changed: 23 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 107 | + | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
120 | 123 | | |
121 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
601 | 609 | | |
602 | 610 | | |
603 | 611 | | |
| 612 | + | |
604 | 613 | | |
605 | 614 | | |
606 | 615 | | |
| |||
677 | 686 | | |
678 | 687 | | |
679 | 688 | | |
680 | | - | |
681 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
682 | 694 | | |
683 | 695 | | |
684 | 696 | | |
| |||
856 | 868 | | |
857 | 869 | | |
858 | 870 | | |
859 | | - | |
| 871 | + | |
860 | 872 | | |
861 | 873 | | |
862 | 874 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
1194 | | - | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
1195 | 1197 | | |
1196 | 1198 | | |
1197 | 1199 | | |
| |||
1410 | 1412 | | |
1411 | 1413 | | |
1412 | 1414 | | |
1413 | | - | |
| 1415 | + | |
1414 | 1416 | | |
1415 | | - | |
1416 | | - | |
| 1417 | + | |
1417 | 1418 | | |
1418 | 1419 | | |
1419 | 1420 | | |
| |||
0 commit comments