Improved docstring
This commit is contained in:
parent
5b0cdc5b21
commit
5d23df5494
11
errors.lua
11
errors.lua
|
@ -1,14 +1,15 @@
|
|||
|
||||
-- Check for possible loading errors
|
||||
--- # Errors
|
||||
--
|
||||
-- Lua library for advanced error handling.
|
||||
|
||||
local string_dist
|
||||
do
|
||||
local thispath = ... and (...):match('.+%.') or ''
|
||||
local this_path = ... and (...):match('.+%.') or ''
|
||||
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 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
|
||||
return lib_or_error
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user