Skip to content

Commit 24a38a8

Browse files
Return error if no broker found using name flag
1 parent b32e26a commit 24a38a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commands/missionctrl/broker/opstatus.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export default class MissionctrlBrokerOpstatus extends ScCommand<typeof Missionc
5757
apiUrl += `?customAttributes=name=="${name}"`
5858
const resp = await conn.get<EventBrokerListApiResponse>(apiUrl)
5959
// FUTURE: show status of multiple brokers operations that match the name
60-
if (resp.data.length > 1) {
60+
if (resp.data.length === 0) {
61+
this.error(`No brokers found with name: ${name}.`)
62+
} else if (resp.data.length > 1) {
6163
this.error(`Multiple broker services found with: ${name}. Exactly one broker service must match the provided name.`)
6264
} else {
6365
brokerId = resp.data[0]?.id

0 commit comments

Comments
 (0)