an if statement does the job perfectly with no errors nor anything
if FailedModuleScriptsInfo[module_script:GetFullName()] then
error("[Provenance."..module_script.Name.."]: "..FailedModuleScriptsInfo[module_script:GetFullName()])
end
the following assert though…
assert(
not FailedModuleScriptsInfo[module_script:GetFullName()],
"[Provenance."..module_script.Name.."]: "..FailedModuleScriptsInfo[module_script:GetFullName()]
)
Assert does not find an index that doesn’t exist. The first argument you give to assert is true (not nil == true) as it should be which means assert is not going to throw an error with the given error message. As you can see from the error message you got, it’s not your own error message. The error is caused by FailedModuleScriptsInfo[module_script:GetFullName()] being nil. When calling assert, both arguments are evaluated. Thus, the error message given to assert is evaluated regardless of the value of the first argument. So even if the error message is not going to be used, it is still evaluated, and in your case, the evaluation errors.