lua/playtime/error.lua

 local _local_1_ = require("playtime.prelude") local clone = _local_1_["clone"] local eq_all_3f = _local_1_["eq-all?"] local eq_any_3f = _local_1_["eq-any?"] local math = _local_1_["math"] local string = _local_1_["string"] local table = _local_1_["table"] local type = _local_1_["type"]


 local function Error(msg, _3fdetails)
 local function get_detail(name)
 local _2_ = (_3fdetails or {})[name] local and_3_ = (nil ~= _2_) if and_3_ then local t = _2_ and_3_ = type["table?"](t) end if and_3_ then local t = _2_
 local _5_ = getmetatable(t) if ((_G.type(_5_) == "table") and (nil ~= _5_.__tostring)) then local f = _5_.__tostring
 return f(t) else local _ = _5_
 return vim.inspect(t) end elseif (nil ~= _2_) then local v = _2_
 return tostring(v) elseif (_2_ == nil) then
 return ("! missing detail value: " .. name .. " !") else return nil end end

 local msg0 = string.gsub(msg, "#{(.-)}", get_detail)
 local e = {msg = msg0, details = _3fdetails} local mt
 local function _8_() return msg0 end mt = {__tostring = _8_}
 return setmetatable(e, mt) end return Error