Improved docstring
This commit is contained in:
parent
5b0cdc5b21
commit
5d23df5494
11
errors.lua
11
errors.lua
|
@ -1,14 +1,15 @@
|
||||||
|
--- # Errors
|
||||||
-- Check for possible loading errors
|
--
|
||||||
|
-- Lua library for advanced error handling.
|
||||||
|
|
||||||
local string_dist
|
local string_dist
|
||||||
do
|
do
|
||||||
local thispath = ... and (...):match('.+%.') or ''
|
local this_path = ... and (...):match('.+%.') or ''
|
||||||
local function import (name, ignore_failure)
|
local function import (name, ignore_failure)
|
||||||
local was_loaded, lib_or_error = pcall(require, thispath..name)
|
local was_loaded, lib_or_error = pcall(require, this_path..name)
|
||||||
if not was_loaded then
|
if not was_loaded then
|
||||||
if ignore_failure then return nil end
|
if ignore_failure then return nil end
|
||||||
error('['..thispath..']: Could not load vital library: '..name..'.lua:\n\t'..lib_or_error)
|
error('['..this_path..']: Could not load vital library: '..name..'.lua:\n\t'..lib_or_error)
|
||||||
end
|
end
|
||||||
return lib_or_error
|
return lib_or_error
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user