Skip to content

Handing status/context in the upstream CLI #915

@wtrocki

Description

@wtrocki

Approach 1

Special error types would be perhaps be needed which are scoped to the data plane CLI.

From data plane CLI, keep it simple with no reference to what command you should use:

var NoRegistrySelectedError = errors.New("no service registry selected")

return NoRegistrySelectedError

When interpreting the error, add additional info:

if rerr, ok := err.(*NoRegistrySelectedError); ok {
  return fmt.Errorf("%w: use 'rhoas service-registry use' to select a registry or pass the `--registry-id` flag")
}

That is a simplistic approach which does not scale very well, but perhaps some kind of abstraction would be helpful to match errors.

Originally posted by @craicoverflow in #859 (comment)

Metadata

Metadata

Assignees

Labels

feature/service-registrypriority/important-soonMust be staffed and worked on either currently or very soon—ideally in time for the next release. Im

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions