From ad4f72f34b816523c2ab8def4ef0deaa89e7097f Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 29 Mar 2023 15:21:01 +0100 Subject: [PATCH] better report issue when parsing command --- src/exabgp/configuration/static/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/exabgp/configuration/static/__init__.py b/src/exabgp/configuration/static/__init__.py index fb6271b53..4bed2c03c 100644 --- a/src/exabgp/configuration/static/__init__.py +++ b/src/exabgp/configuration/static/__init__.py @@ -144,7 +144,9 @@ def attributes(tokeniser): rd = route_distinguisher(tokeniser) continue - action = ParseStatic.action[command] + action = ParseStatic.action.get(command, '') + if action == '': + raise ValueError(f"The command '{command}' is not known or valid where used") if action == 'attribute-add': attr.add(ParseStatic.known[command](tokeniser))