You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pcall will now actually catch any errors that
occur when we require the provider.
Instead of several if-blocks, just assert that
type(provider) == "function". This catches
all of our previous edge-cases, like when
provider == nil.
assert(type(provider) =="function", "The package provider "
91
+
..package_table.pkgType
92
+
.."is malformed (type should be function). Something is wrong with the provider's backend code. Unless you are writing your own provider, please report this error.")
91
93
provider(package_table)
92
-
end
93
-
94
-
-- catch unknown providers
95
-
ifnotmatchthen
96
-
ifnotpackage_table.pkgType==nilthen
97
-
error(
98
-
"Package provider "
99
-
..package_table.pkgType
100
-
.." is unknown. You are either missing the appropriate package provider or something is wrong with the package."
101
-
)
102
-
end
94
+
else
95
+
error(
96
+
"Package provider "
97
+
..package_table.pkgType
98
+
.." is unknown. You are either missing the appropriate package provider or something is wrong with the package."
0 commit comments