diff core/moduleapi.lua @ 14101:3e6bb6ffbd43 13.0

core.moduleapi: Use default value when enum option has incorrect value Is an error without consequences even an error?
author Kim Alvefur <zash@zash.se>
date Wed, 11 Mar 2026 16:53:48 +0100
parents 4309c934e813
children a124e80d3498 374b72785488
line wrap: on
line diff
--- a/core/moduleapi.lua	Thu Nov 20 10:04:06 2025 +0100
+++ b/core/moduleapi.lua	Wed Mar 11 16:53:48 2026 +0100
@@ -400,6 +400,7 @@
 	local options = set.new{default, ...};
 	if not options:contains(value) then
 		self:log("error", "Config option '%s' not in set of allowed values (one of: %s)", name, options);
+		return default;
 	end
 	return value;
 end