Track the operation owning internal errors
This commit is contained in:
@@ -39,7 +39,7 @@ func (r *Runner) resolveProfileSelection(
|
||||
}
|
||||
selectedProfile, err := r.profiles.GetProfile(ctx, lookupID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %w", ErrProfileLoad, err)
|
||||
return nil, profileLookupError(err)
|
||||
}
|
||||
if selectedProfile == nil {
|
||||
return nil, fmt.Errorf("%w: profile repository returned nil profile", ErrProfileLoad)
|
||||
@@ -64,7 +64,7 @@ func (r *Runner) resolveProfileIdentity(ctx context.Context, profileID string) (
|
||||
if indexed, ok := r.profiles.(profileIdentityRepository); ok {
|
||||
identity, err := indexed.GetProfileIdentity(ctx, lookupID)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%w: %w", ErrProfileLoad, err)
|
||||
return "", profileLookupError(err)
|
||||
}
|
||||
return identity, nil
|
||||
}
|
||||
@@ -108,7 +108,7 @@ func (r *Runner) InspectProfile(
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, fmt.Errorf("%w: %w", ErrProfileLoad, ctx.Err())
|
||||
return nil, &OperationError{Category: ErrProfileLoad, Cause: ctx.Err()}
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ func (r *Runner) InspectProfile(
|
||||
target.APIKey = ""
|
||||
params, err := jsonvalue.CopyMap(target.ExtraParams)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: profile extra parameters: %w", ErrProfileLoad, err)
|
||||
return nil, &OperationError{Category: ErrProfileLoad, Cause: fmt.Errorf("profile extra parameters: %w", err)}
|
||||
}
|
||||
target.ExtraParams = params
|
||||
|
||||
|
||||
Reference in New Issue
Block a user