Skip to content

Commit aae5523

Browse files
committed
fix: better errors
Signed-off-by: bupd <[email protected]>
1 parent a07dd09 commit aae5523

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/controller/replication/execution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (c *controller) Start(ctx context.Context, policy *replicationmodel.Policy,
125125
},
126126
})
127127
if err != nil {
128-
return 0, err
128+
return 0, fmt.Errorf("failed to count running executions for policy ID: %d: %v", policy.ID, err)
129129
}
130130

131131
if count > 1 {

src/controller/replication/flow/copy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (c *copyFlow) createTasks(ctx context.Context, srcResources, dstResources [
136136
Metadata: &job.Metadata{
137137
JobKind: job.KindGeneric,
138138
},
139-
Parameters: map[string]interface{}{
139+
Parameters: map[string]any{
140140
"src_resource": string(src),
141141
"dst_resource": string(dest),
142142
"speed": speed,

src/server/v2.0/handler/replication.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (r *replicationAPI) CreateReplicationPolicy(ctx context.Context, params ope
115115

116116
if params.Policy.SingleActiveReplication != nil {
117117
// Validate and assign SingleActiveReplication only for non-event_based triggers
118-
if params.Policy.Trigger.Type == "event_based" && *params.Policy.SingleActiveReplication == true {
118+
if params.Policy.Trigger.Type == model.TriggerTypeEventBased && *params.Policy.SingleActiveReplication == true {
119119
return r.SendError(ctx, fmt.Errorf("single active replication is not allowed for event_based triggers"))
120120
}
121121
policy.SingleActiveReplication = *params.Policy.SingleActiveReplication

0 commit comments

Comments
 (0)