[
https://issues.apache.org/jira/browse/YUNIKORN-2262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17865388#comment-17865388
]
Chia-Ping Tsai commented on YUNIKORN-2262:
------------------------------------------
[~wilfreds] thanks for sharing. the following responses are just my education.
{quote}
If you use the %w you would need to use string contains etc for these kinds of
checks. Really fragile, the slightest change can break that. Using the join
makes code readable and if we use predefined errors it will not break.
{quote}
IIRC, the placeholder %w will add the error to the err's tree, so `Is` can work
with %w. see the example: https://go.dev/play/p/wE1tb-RYWE__P
{code:go}
e := fmt.Errorf("failed due to %w", http.ErrServerClosed)
println(errors.Is(e, http.ErrServerClosed))
{code}
the output is "true".
I assumed that `Join` is better than `%w` when the number of errors are larger
than 2. In that scenario, it indeed is weird to have multi %w to combine all of
errors.
In short, I want to understand the benefit in using `Join` when there are only
"two" errors.
> propagate the error message when queue creation gets failed
> -----------------------------------------------------------
>
> Key: YUNIKORN-2262
> URL: https://issues.apache.org/jira/browse/YUNIKORN-2262
> Project: Apache YuniKorn
> Issue Type: Improvement
> Reporter: Chia-Ping Tsai
> Assignee: Chenchen Lai
> Priority: Minor
>
> [https://github.com/apache/yunikorn-core/blob/master/pkg/scheduler/partition.go#L334]
> the error message of root cause is swallowed, so it is hard to be inspired by
> the common message "failed to create rule based queue ..."
> BTW, the error I met is the parent queue "is already a leaf". The error
> message is helpful and it makes us catch up the root cause easily.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]