Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Promise use template for exception #32

Closed
wants to merge 1 commit into from
Closed

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
*
* @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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant