Skip to content

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Jan 3, 2024

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Related tickets see php-http/client-common#234
Documentation -
License MIT

What's in this PR?

have Promise use a template for the exception class.

Why?

in httplug, we have documentation text that formulates that only specific exceptions may be used for the callback. the change in 1.2.0 to allow any Throwable was incorrect.

Usage

See https://phpstan.org/r/6ec99fad-fd67-4f64-ac0d-ba135e207700

@dbu dbu force-pushed the template-exception branch 3 times, most recently from b06af4c to be2baa8 Compare January 3, 2024 18:12
in httplug, we have documentation text that formulates that only specific exceptions may be used for the callback. the change in 1.2.0 to allow any Throwable was incorrect.
@dbu dbu force-pushed the template-exception branch from be2baa8 to 4874a14 Compare January 3, 2024 18:23
* @param callable(E): V|null $onRejected called when an exception occurs
*
* @return Promise<V> a new resolved promise with value of the executed callback (onFulfilled / onRejected)
* @return Promise<V, E> a new resolved promise with value of the executed callback (onFulfilled / onRejected)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have T, V and E - how do we correctly specify this?

@dbu dbu mentioned this pull request Jan 4, 2024
@dbu dbu closed this Jan 4, 2024
@dbu dbu deleted the template-exception branch January 4, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant