1
0

Improved docstring

This commit is contained in:
Jon Michael Aanes 2024-07-10 19:17:22 +02:00
parent 5b0cdc5b21
commit 5d23df5494
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -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