-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
good first issueIssues that are good for first time contributors to tackleIssues that are good for first time contributors to tacklehelp wantedIssues we need help with tacklingIssues we need help with tacklingproposalProposed Specification or API changeProposed Specification or API change
Description
issue starts with #2170
Many code snippets are used this way.
RetryableException(
response.status(),
RATE_LIMIT_EXCEEDED,
response.request().httpMethod(),
null, // Date type (original)
response.request(),
)However, this code will not work with that change.
- get a compile time error
Overload resolution ambiguity:
public constructor RetryableException(p0: Int, p1: String!, p2: Request.HttpMethod!, p3: Date!, p4: Request!) defined in feign.RetryableException
public constructor RetryableException(p0: Int, p1: String!, p2: Request.HttpMethod!, p3: Long!, p4: Request!) defined in feign.RetryableException- ambiguous what to do when we don't want to use retry.
- Just looking at the code in the IDE didn't work, so I came to repository.
Two solutions to solve this problem
it's not intuitive, and it creates more confusion.
// first solution
RetryableException(
response.status(),
RATE_LIMIT_EXCEEDED,
response.request().httpMethod(),
null as Long?,
response.request(),
)// second solution
val nonRetryable: Long? = null
RetryableException(
response.status(),
RATE_LIMIT_EXCEEDED,
response.request().httpMethod(),
nonRetryable,
response.request(),
)Suggest two things
- fundamentally fix the overload resolution ambiguity.
- need to ideation about how to fix it.
- annotate how it should be written in the new constructor when don't want to retry.
- What about adding it to a new constructor?
young0264young0264 and neseleznev
Metadata
Metadata
Assignees
Labels
good first issueIssues that are good for first time contributors to tackleIssues that are good for first time contributors to tacklehelp wantedIssues we need help with tacklingIssues we need help with tacklingproposalProposed Specification or API changeProposed Specification or API change