|
184 | 184 | "text/markdown": [ |
185 | 185 | "---\n", |
186 | 186 | "\n", |
187 | | - "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L63){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 187 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L64){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
188 | 188 | "\n", |
189 | 189 | "#### HTTP4xxClientError\n", |
190 | 190 | "\n", |
|
195 | 195 | "text/plain": [ |
196 | 196 | "---\n", |
197 | 197 | "\n", |
198 | | - "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L63){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 198 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L64){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
199 | 199 | "\n", |
200 | 200 | "#### HTTP4xxClientError\n", |
201 | 201 | "\n", |
|
223 | 223 | "text/markdown": [ |
224 | 224 | "---\n", |
225 | 225 | "\n", |
226 | | - "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L68){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 226 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L69){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
227 | 227 | "\n", |
228 | 228 | "#### HTTP5xxServerError\n", |
229 | 229 | "\n", |
|
234 | 234 | "text/plain": [ |
235 | 235 | "---\n", |
236 | 236 | "\n", |
237 | | - "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L68){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 237 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/net.py#L69){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
238 | 238 | "\n", |
239 | 239 | "#### HTTP5xxServerError\n", |
240 | 240 | "\n", |
|
284 | 284 | " (431,'Header Fields Too Large'),(451,'Legal Reasons')\n", |
285 | 285 | ")\n", |
286 | 286 | "\n", |
287 | | - "def _mk_error(nm, code, msg):\n", |
288 | | - " cls = get_class(nm, 'url', 'hdrs', 'fp', sup=HTTP4xxClientError, msg=msg, code=code)\n", |
289 | | - " def _init(self, url, hdrs, fp, msg=msg, code=code): super(cls, self).__init__(url, code, msg, hdrs, fp)\n", |
290 | | - " cls.__init__ = _init\n", |
291 | | - " return cls\n", |
292 | | - "\n", |
293 | 287 | "for code,msg in _httperrors:\n", |
294 | 288 | " nm = f'HTTP{code}{msg.replace(\" \",\"\")}Error'\n", |
295 | | - " globals()[nm] = ExceptionsHTTP[code] = _mk_error(nm, code, msg)" |
| 289 | + " def _init(self, url, hdrs, fp, msg=msg, code=code): HTTP4xxClientError.__init__(self, url, code, msg, hdrs, fp)\n", |
| 290 | + " cls = type(nm, (HTTP4xxClientError,), {'__init__':_init})\n", |
| 291 | + " globals()[nm] = ExceptionsHTTP[code] = cls" |
296 | 292 | ] |
297 | 293 | }, |
298 | 294 | { |
|
0 commit comments