mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
docs(async): add note about deadline()
DOMException
name of TimeoutError
(#5833)
* docs(async): add note about deadline DOMException name of TimeoutError * Document all cases for thrown error
This commit is contained in:
parent
29fdb0d536
commit
2e209c0ff6
@ -16,8 +16,12 @@ export interface DeadlineOptions {
|
||||
* Note: Prefer to use {@linkcode AbortSignal.timeout} instead for the APIs
|
||||
* that accept {@linkcode AbortSignal}.
|
||||
*
|
||||
* @throws {DOMException} When the provided duration runs out before resolving
|
||||
* or if the optional signal is aborted, and `signal.reason` is undefined.
|
||||
* @throws {DOMException & { name: "TimeoutError" }} If the provided duration
|
||||
* runs out before resolving.
|
||||
* @throws {DOMException & { name: "AbortError" }} If the optional signal is
|
||||
* aborted with the default `reason` before resolving or timing out.
|
||||
* @throws {AbortSignal["reason"]} If the optional signal is aborted with a
|
||||
* custom `reason` before resolving or timing out.
|
||||
* @typeParam T The type of the provided and returned promise.
|
||||
* @param p The promise to make rejectable.
|
||||
* @param ms Duration in milliseconds for when the promise should time out.
|
||||
|
Loading…
Reference in New Issue
Block a user