Use native configuration validation and diagnostics
This commit is contained in:
@@ -77,10 +77,6 @@ func configurationCommand(deps commandDependencies) commandkit.Command {
|
||||
scopes[index].Acquire = func(ctx context.Context, request ckconfig.Request, input configurationSelection, state *configurationInspectionState) (commandkit.Acquired[ckconfig.View], error) {
|
||||
result, err := acquire(ctx, request, input, state)
|
||||
result.Diagnostics = append(result.Diagnostics, state.bootstrapDiagnostics()...)
|
||||
var identity *config.SessionIdentityError
|
||||
if errors.As(err, &identity) {
|
||||
result.Explanation.Message = identity.Error()
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
compare := scopes[index].Compare
|
||||
@@ -89,10 +85,6 @@ func configurationCommand(deps commandDependencies) commandkit.Command {
|
||||
separate.independent = true
|
||||
result, err := compare(ctx, request, &separate)
|
||||
result.Diagnostics = append(result.Diagnostics, state.bootstrapDiagnostics()...)
|
||||
var identity *config.SessionIdentityError
|
||||
if errors.As(err, &identity) {
|
||||
result.Explanation.Message = identity.Error()
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user