Assert on unexpected config value when prompting

This branch gets entered if the value of a setting linked to a feature
is anything other than True, False or "ask". I think this could only
happen due to a programming error, for example when you add an entry to
`_WebEnginePermissions` that was linked to a String type setting. So I
think putting an assert here instead of a warning should be fine and
more explicit. (Or should be be `utils.Unreachable`? Or `ValueError`?)
This commit is contained in:
toofar 2024-11-10 14:38:47 +13:00
parent 7535207fd3
commit 57465a6768
1 changed files with 1 additions and 3 deletions

View File

@ -341,12 +341,10 @@ def feature_permission(url, option, msg, yes_action, no_action, abort_on,
no_action()
return None
else:
log.misc.warning(
raise AssertionError(
f"Unsupported value for permission prompt setting ({option}), expected boolean or "
f"'ask', got: {config_val} ({type(config_val)})"
)
no_action()
return None
def get_tab(win_id, target):