html_url,issue_url,id,node_id,user,user_label,created_at,updated_at,author_association,body,reactions,issue,issue_label,performed_via_github_app https://github.com/simonw/datasette/issues/1770#issuecomment-1185937664,https://api.github.com/repos/simonw/datasette/issues/1770,1185937664,IC_kwDOBm6k_c5Gr_kA,9599,simonw,2022-07-15T21:03:09Z,2022-07-17T22:25:44Z,OWNER,"Design decision: ```python @hookspec def handle_exception(datasette, request, exception): """"""Handle an uncaught exception. Can return a Response or None."""""" ``` It will also support returning an awaitable, using the `await_me_maybe` pattern.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1306492437,`handle_exception` plugin hook for custom error handling, https://github.com/simonw/datasette/issues/1770#issuecomment-1186630298,https://api.github.com/repos/simonw/datasette/issues/1770,1186630298,IC_kwDOBm6k_c5Guoqa,9599,simonw,2022-07-17T23:29:37Z,2022-07-17T23:29:37Z,OWNER,Documentation for the new hook: https://docs.datasette.io/en/latest/plugin_hooks.html#handle-exception-datasette-request-exception,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1306492437,`handle_exception` plugin hook for custom error handling, https://github.com/simonw/datasette/issues/1770#issuecomment-1186620168,https://api.github.com/repos/simonw/datasette/issues/1770,1186620168,IC_kwDOBm6k_c5GumMI,9599,simonw,2022-07-17T22:37:01Z,2022-07-17T22:37:01Z,OWNER,"I need to refactor this code so that `Forbidden` exceptions are handled separately. Reason is that those already have a plugin hook of their own: https://github.com/simonw/datasette/blob/8188f55efc0fcca1be692b0d0c875f2d1ee99f17/datasette/app.py#L1384-L1395 My first attempt at this refactored that entire `handle_exception` method to call the new plugin hook, moving its current implementation into a `datasette/handle_exception.py` default plugin implementation - but it felt weird having that plugin implementation then itself call the `pm.hook.forbidden()` hook.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1306492437,`handle_exception` plugin hook for custom error handling, https://github.com/simonw/datasette/issues/1770#issuecomment-1186620367,https://api.github.com/repos/simonw/datasette/issues/1770,1186620367,IC_kwDOBm6k_c5GumPP,9599,simonw,2022-07-17T22:38:25Z,2022-07-17T22:38:25Z,OWNER,I think this is the right place to move the code to catch `Forbidden` exceptions (and forwards them to that plugin hook): https://github.com/simonw/datasette/blob/8188f55efc0fcca1be692b0d0c875f2d1ee99f17/datasette/app.py#L1269-L1278,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1306492437,`handle_exception` plugin hook for custom error handling, https://github.com/simonw/datasette/issues/1770#issuecomment-1186629556,https://api.github.com/repos/simonw/datasette/issues/1770,1186629556,IC_kwDOBm6k_c5Guoe0,9599,simonw,2022-07-17T23:25:08Z,2022-07-17T23:25:08Z,OWNER,Keeping this issue open until I've proven the new plugin hook works by releasing a plugin that uses it.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1306492437,`handle_exception` plugin hook for custom error handling,