|
1 | 1 | # @httpx/exception
|
2 | 2 |
|
| 3 | +## 1.7.2 |
| 4 | + |
| 5 | +### Patch Changes |
| 6 | + |
| 7 | +- [#309](https://github.com/belgattitude/httpx/pull/309) [`67321bc`](https://github.com/belgattitude/httpx/commit/67321bc51e1937f5159daee99567ee9c530eabb2) Thanks [@belgattitude](https://github.com/belgattitude)! - Fix missing serializer export for commonjs (esm worked) |
| 8 | + |
3 | 9 | ## 1.7.1
|
4 | 10 |
|
5 | 11 | ### Patch Changes
|
|
19 | 25 | const e400 = new HttpBadRequest({
|
20 | 26 | errors: [
|
21 | 27 | {
|
22 |
| - message: "Invalid email", |
23 |
| - path: "email", |
24 |
| - code: "invalid_email", |
| 28 | + message: 'Invalid email', |
| 29 | + path: 'email', |
| 30 | + code: 'invalid_email', |
25 | 31 | },
|
26 | 32 | {
|
27 |
| - message: "Invalid address", |
28 |
| - path: ["addresses", 0, "line1"], |
29 |
| - code: "empty_string", |
| 33 | + message: 'Invalid address', |
| 34 | + path: ['addresses', 0, 'line1'], |
| 35 | + code: 'empty_string', |
30 | 36 | },
|
31 | 37 | ],
|
32 | 38 | });
|
|
107 | 113 |
|
108 | 114 | ```typescript
|
109 | 115 | const err = new HttpRequestTimeout({
|
110 |
| - url: "https://api.dev/user/belgattitude", |
111 |
| - method: "GET", |
112 |
| - code: "NETWORK_FAILURE", |
| 116 | + url: 'https://api.dev/user/belgattitude', |
| 117 | + method: 'GET', |
| 118 | + code: 'NETWORK_FAILURE', |
113 | 119 | errorId: nanoid(), // can be shared by frontend/backend
|
114 | 120 | });
|
115 | 121 | console.log(err.url, err.method, err.code, err.errorId);
|
|
129 | 135 | import {
|
130 | 136 | convertToSerializable,
|
131 | 137 | createFromSerializable,
|
132 |
| - } from "@httpx/exception/serializer"; |
| 138 | + } from '@httpx/exception/serializer'; |
133 | 139 |
|
134 | 140 | const serializableObject = convertToSerializable(new HttpForbidden());
|
135 | 141 | const exception = createFromSerializable(serializableObject);
|
|
166 | 172 | import {
|
167 | 173 | HttpForbidden,
|
168 | 174 | HttpUnavailableForLegalReasons,
|
169 |
| - } from "@httpx/exception"; |
170 |
| - import { fromJson, toJson } from "@httpx/exception/serializer"; |
| 175 | + } from '@httpx/exception'; |
| 176 | + import { fromJson, toJson } from '@httpx/exception/serializer'; |
171 | 177 |
|
172 | 178 | const e = new HttpForbidden({
|
173 |
| - url: "https://www.cool.me", |
| 179 | + url: 'https://www.cool.me', |
174 | 180 | /*
|
175 | 181 | cause: new HttpUnavailableForLegalReasons({
|
176 | 182 | cause: new Error('example with cause')
|
|
0 commit comments