Module:Error

local p = {}

local utilsError = require("Module:UtilsError")

local Constants = mw.loadData("Module:Constants/Data")

local DEFAULT_WARN_MESSAGE = "An error occurred" local CATEGORY_ERRORS = "Category:"..Constants.category.templateErrors

function p.Warn(frame) local message, category = frame.args[1], frame.args[2] local errorCategory = category or CATEGORY_ERRORS utilsError.warn(message or DEFAULT_WARN_MESSAGE) return ""..errorCategory.."" end

function p.Error(frame) local message, category = frame.args[1], frame.args[2] local errorCategory = category or CATEGORY_ERRORS return utilsError.error(message, true)..""..errorCategory.."" end

return p