Track the operation owning internal errors
This commit is contained in:
@@ -36,7 +36,7 @@ func (r *Runner) InspectRequirements(
|
||||
return nil, fmt.Errorf("%w: session_id: %v", ErrInvalidRequest, err)
|
||||
}
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, fmt.Errorf("%w: %w", ErrPromptLoad, err)
|
||||
return nil, &OperationError{Category: ErrPromptLoad, Cause: err}
|
||||
}
|
||||
|
||||
selection, err := r.resolvePromptInspection(ctx, req.PromptID)
|
||||
@@ -44,7 +44,7 @@ func (r *Runner) InspectRequirements(
|
||||
return nil, err
|
||||
}
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, fmt.Errorf("%w: %w", ErrProfileLoad, err)
|
||||
return nil, &OperationError{Category: ErrProfileLoad, Cause: err}
|
||||
}
|
||||
selectedProfileID := req.ProfileID
|
||||
if strings.TrimSpace(selectedProfileID) == "" {
|
||||
@@ -58,7 +58,7 @@ func (r *Runner) InspectRequirements(
|
||||
return nil, err
|
||||
}
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, fmt.Errorf("%w: %w", ErrPromptLoad, err)
|
||||
return nil, &OperationError{Category: ErrPromptLoad, Cause: err}
|
||||
}
|
||||
|
||||
repository, ok := r.promptDefs.(requirementSnapshotRepository)
|
||||
@@ -72,7 +72,7 @@ func (r *Runner) InspectRequirements(
|
||||
definition := &domain.PromptDefinition{ID: selection.PromptID}
|
||||
inspection, err := prompt.AnalyzeRequirements(ctx, definition, snapshot, req.Vars, directSessionID != "")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %w", ErrPromptLoad, err)
|
||||
return nil, &OperationError{Category: ErrPromptLoad, Cause: err}
|
||||
}
|
||||
inspection.ProfileID = profileIdentity
|
||||
return &inspection, nil
|
||||
|
||||
Reference in New Issue
Block a user