Skip to content

Commit 32cf143

Browse files
committed
check for watch support
1 parent cfb61ea commit 32cf143

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,12 @@ export class Message {
455455
try {
456456
msg = WatchMessage.assign(this.data);
457457
if (NoderedUtil.IsNullEmpty(msg.jwt)) { msg.jwt = cli.jwt; }
458-
await cli.UnWatch(msg.id, msg.jwt);
458+
if (Config.supports_watch) {
459+
await cli.UnWatch(msg.id, msg.jwt);
460+
} else {
461+
msg.error = "Watch is not supported by this openflow";
462+
}
463+
459464
msg.result = null;
460465
} catch (error) {
461466
if (NoderedUtil.IsNullUndefinded(msg)) { (msg as any) = {}; }

0 commit comments

Comments
 (0)