From 975fc44f1a865199c5530623f300200825dcb136 Mon Sep 17 00:00:00 2001 From: Fabio Zendhi Nagao Date: Thu, 25 Jul 2024 12:35:09 -0300 Subject: [PATCH] docs(timeout): `TaskCancelledError` never gets executed on Cooperative (#98) `TimeoutStrategy.Cooperative` throws the delegate exception, so it won't fire `TaskCancelledError` as shown in example. Switching to `TimeoutStrategy.Aggressive` is required to the example to work as expected. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 145d7d7..d8966ff 100644 --- a/readme.md +++ b/readme.md @@ -818,7 +818,7 @@ Creates a timeout policy. The duration specifies how long to wait before timing ```js import { TimeoutStrategy, timeout, TaskCancelledError } from 'cockatiel'; -const timeout = timeout(2000, TimeoutStrategy.Cooperative); +const timeout = timeout(2000, TimeoutStrategy.Aggressive); export async function handleRequest() { try {