ryankert01 commented on code in PR #918:
URL: https://github.com/apache/yunikorn-core/pull/918#discussion_r1688461188


##########
pkg/scheduler/partition.go:
##########
@@ -324,12 +324,12 @@ func (pc *PartitionContext) AddApplication(app 
*objects.Application) error {
                if isRecoveryQueue {
                        queue, err = pc.createRecoveryQueue()
                        if err != nil {
-                               return fmt.Errorf("failed to create recovery 
queue %s for application %s", common.RecoveryQueueFull, appID)
+                               return fmt.Errorf(strings.Join([]string{"failed 
to create recovery queue", queueName, "for application", appID, ":", 
err.Error()}, " "))
                        }
                } else {
                        queue, err = pc.createQueue(queueName, app.GetUser())
                        if err != nil {
-                               return fmt.Errorf("failed to create rule based 
queue %s for application %s", queueName, appID)
+                               return fmt.Errorf(strings.Join([]string{"failed 
to create rule based queue", queueName, "for application", appID, ":", 
err.Error()}, " "))

Review Comment:
   ditto.



##########
pkg/scheduler/partition.go:
##########
@@ -324,12 +324,12 @@ func (pc *PartitionContext) AddApplication(app 
*objects.Application) error {
                if isRecoveryQueue {
                        queue, err = pc.createRecoveryQueue()
                        if err != nil {
-                               return fmt.Errorf("failed to create recovery 
queue %s for application %s", common.RecoveryQueueFull, appID)
+                               return fmt.Errorf(strings.Join([]string{"failed 
to create recovery queue", queueName, "for application", appID, ":", 
err.Error()}, " "))

Review Comment:
   I think it should be error.join(), as mentioned in the jira comment section.
   
   an quick example:
   ```go
   package main
   
   import (
        "errors"
        "fmt"
   )
   
   func main() {
        err1 := errors.New("err1")
        err2 := errors.New("err2")
        err := errors.Join(err1, err2)
        fmt.Println(err)
        if errors.Is(err, err1) {
                fmt.Println("err is err1")
        }
        if errors.Is(err, err2) {
                fmt.Println("err is err2")
        }
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to