Diff

util/error.lua @ 10365:744ca71a49f7

util.error: Add well-known field 'code' in error templates Intended to be for HTTP-ish numeric status codes
author Kim Alvefur <zash@zash.se>
date Fri, 01 Nov 2019 18:31:12 +0100
parent 10069:6f317e51544d
child 10493:d9132e7412b8
line wrap: on
line diff
--- a/util/error.lua	Fri Nov 01 18:11:58 2019 +0100
+++ b/util/error.lua	Fri Nov 01 18:31:12 2019 +0100
@@ -14,6 +14,7 @@
 		type = template.type or "cancel";
 		condition = template.condition or "undefined-condition";
 		text = template.text;
+		code = template.code or 500;
 
 		context = context or template.context or { _error_id = e };
 	}, error_mt);