chia7712 commented on code in PR #918:
URL: https://github.com/apache/yunikorn-core/pull/918#discussion_r1690024045
##########
pkg/scheduler/partition.go:
##########
@@ -324,12 +325,14 @@ 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)
+ outter_err := fmt.Errorf("failed to create
recovery queue %s for application %s", common.RecoveryQueueFull, appID)
+ return errors.Join(outter_err, err)
}
} 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)
+ outter_err := fmt.Errorf("failed to create rule
based queue %s for application %s", queueName, appID)
+ return errors.Join(outter_err, err)
Review Comment:
ditto: `return errors.Join(fmt.Errorf("failed to create rule based queue %s
for application %s", queueName, appID), err)`
##########
pkg/scheduler/partition.go:
##########
@@ -324,12 +325,14 @@ 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)
+ outter_err := fmt.Errorf("failed to create
recovery queue %s for application %s", common.RecoveryQueueFull, appID)
+ return errors.Join(outter_err, err)
Review Comment:
how about: `return errors.Join(fmt.Errorf("failed to create recovery queue
%s for application %s", common.RecoveryQueueFull, appID), err)`
--
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]