Skip to content

Commit 50cd4ce

Browse files
committed
Do not raise Exception in nftables
1 parent b8d5781 commit 50cd4ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/schains/firewall/nftables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def remove_rule(self, rule: SChainRule) -> None:
224224
output = None
225225
rc, output, error = self.run_cmd(f'list chain {self.FAMILY} {self.table} {self.chain}')
226226
if rc != 0:
227-
raise Exception(f'Failed to list rules: {error}')
227+
raise NFTablesCmdFailedError(f'Failed to list rules: {error}')
228228

229229
current_rules = json.loads(output)
230230

@@ -237,7 +237,7 @@ def remove_rule(self, rule: SChainRule) -> None:
237237
break
238238

239239
if handle is None:
240-
raise Exception('Rule not found')
240+
raise NFTablesCmdFailedError('Rule not found')
241241

242242
json_cmd = self._compose_json(
243243
[

0 commit comments

Comments
 (0)