Retsam
d73f413fb6
Fix inferred types for targetted error handlers
...
The typings for targetted catch statements don't infer properly with Error constructors, for example with `.catch(SomeErrorSubtype, (e) => /*...*/)`, `e` is inferred to be the constructor of SomeErrorSubtype, not an instance of SomeErrorSubtype, so this must be explicitly typed as `.catch(SomeErrorSubtype, (e: SomeErrorSubtype) => /*...*/)` for the typings to be accurate. The root causes is that it is erroneously falling into the wrong overload, the overload that accepts arbitrary objects as the first argument to .catch. This fix requires loosening the restriction that SomeErrorSubtype must be a subtype of Error, but otherwise preserves existing behavior.
Also, makes a utility type to reduce some of the boilerplate.
2017-12-13 14:02:42 -05:00
..
2017-12-05 18:27:52 +01:00
2017-12-12 08:51:28 -08:00
2017-12-09 09:59:31 -08:00
2017-12-06 06:37:42 -05:00
2017-12-04 22:42:14 -05:00
2017-12-06 08:49:04 -08:00
2017-12-05 17:03:16 -06:00
2017-12-08 10:54:41 -08:00
2017-12-05 20:14:03 +01:00
2017-12-04 13:57:50 -07:00
2017-12-10 15:46:18 -08:00
2017-12-13 14:02:42 -05:00
2017-12-06 17:28:33 +08:00
2017-12-11 10:55:20 -08:00
2017-12-11 13:01:28 +08:00
2017-12-11 14:13:34 -08:00
2017-12-11 11:57:33 +01:00
2017-12-04 11:01:50 +09:00
2017-12-10 20:30:07 +02:00
2017-12-08 02:30:51 +01:00
2017-12-07 17:03:09 +01:00
2017-12-04 18:26:03 +01:00
2017-12-05 13:26:22 +01:00
2017-12-06 14:18:09 +01:00
2017-12-06 00:37:54 -05:00
2017-12-04 17:32:04 -08:00
2017-12-04 12:26:48 +01:00
2017-12-07 20:00:44 -08:00
2017-12-06 11:08:25 -08:00
2017-12-02 11:26:31 -08:00
2017-12-02 11:26:31 -08:00
2017-12-02 11:26:31 -08:00
2017-12-03 22:41:26 +01:00
2017-12-06 06:37:42 -05:00
2017-12-03 19:07:05 +01:00
2017-12-04 22:42:14 -05:00
2017-12-05 14:20:27 +01:00
2017-12-12 19:25:40 +01:00
2017-12-12 19:14:23 +01:00
2017-12-12 19:21:38 +01:00
2017-12-10 23:34:48 -08:00
2017-12-04 09:04:41 +07:00
2017-12-05 12:10:05 +02:00
2017-12-08 13:36:53 -08:00
2017-12-04 11:51:42 +09:00
2017-12-12 15:30:51 -06:00
2017-12-06 13:42:05 -07:00
2017-12-08 21:57:17 +09:00
2017-12-06 15:56:39 -08:00
2017-12-11 23:54:17 +00:00
2017-12-05 08:53:30 -07:00
2017-12-04 21:10:24 +09:00
2017-12-05 12:29:04 -07:00
2017-12-06 21:11:10 +00:00
2017-12-06 21:00:14 +00:00
2017-12-06 20:16:35 +00:00
2017-12-05 08:32:40 +01:00
2017-12-06 21:24:05 +00:00
2017-12-02 21:38:58 -08:00
2017-12-06 07:36:10 -08:00
2017-12-03 11:53:58 +01:00
2017-12-12 14:30:06 -08:00
2017-12-08 17:12:09 +01:00
2017-12-11 09:14:14 -08:00
2017-12-05 00:22:50 +08:00
2017-12-09 17:45:52 -05:00
2017-12-13 12:41:28 +00:00
2017-12-07 14:17:24 +01:00
2017-12-04 17:32:04 +13:00
2017-12-10 22:57:58 +01:00
2017-12-06 13:14:57 -05:00
2017-12-04 22:42:14 -05:00
2017-12-06 00:00:23 +08:00
2017-12-09 12:38:47 +01:00
2017-12-11 11:18:44 +08:00
2017-12-06 09:11:28 +01:00
2017-12-09 02:04:06 +07:00
2017-12-08 09:14:20 -08:00
2017-12-11 12:30:52 +00:00
2017-12-10 02:59:08 +05:30
2017-12-05 12:13:28 +01:00
2017-12-11 17:06:24 -08:00
2017-12-04 10:39:31 -06:00
2017-12-05 10:29:51 +01:00
2017-12-12 11:26:34 +00:00
2017-12-11 15:57:28 -05:00
2017-12-11 20:05:26 +02:00
2017-12-11 17:11:07 -08:00
2017-12-06 11:07:11 -07:00
2017-12-06 18:10:07 -03:00
2017-12-04 19:00:18 +00:00
2017-12-12 15:53:16 -08:00
2017-12-11 09:36:31 +01:00
2017-12-10 12:57:49 +05:00
2017-12-08 18:08:46 -05:00
2017-12-04 10:13:58 -08:00
2017-12-11 15:33:50 -08:00
2017-12-07 19:42:38 +03:00
2017-12-04 22:42:14 -05:00
2017-12-05 12:56:21 -05:00
2017-12-06 08:06:59 -08:00
2017-12-05 11:00:46 +02:00
2017-12-09 00:31:31 +01:00
2017-12-03 13:42:25 +03:00
2017-12-05 09:51:10 +01:00
2017-12-04 17:35:14 -08:00
2017-12-06 10:16:28 +02:00
2017-12-06 16:27:55 -08:00