Commit 1bbe9d8
lexeyo
fix postgres, utils: changed narrowing overflow exception type
Add a new template parameter `Exception` to `utils::numeric_cast` to allow explicit specification of a thrown exception type.
Adds a new exception type `NarrowingOverflow` to indicate overflows during narrowing numeric conversions.
Changes the exception type thrown on narrowing overflow in `IntegralBinaryParser` from `std::runtime_error` to `NarrowingOverflow` to provide additional exception information and simplify exception handling.
commit_hash:24e08d7610b16da62c432ecc09e40d0ad5d2773c1 parent b042777 commit 1bbe9d8
File tree
4 files changed
+19
-10
lines changed- postgresql
- include/userver/storages/postgres
- io
- src/storages/postgres/tests
- universal/include/userver/utils
4 files changed
+19
-10
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
741 | 749 | | |
742 | 750 | | |
743 | 751 | | |
| |||
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
62 | | - | |
63 | | - | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | | - | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
71 | | - | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments