Skip to content

Commit

Permalink
Update StackProcessor.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
devSparkle committed Feb 5, 2024
1 parent baeacad commit 4ddac76
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions src/Integrations/StackProcessor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,45 @@ local function ConvertStacktraceToFrames(Event, Hint)
end
end

if SourceScript then
local Parent = SourceScript
Path = ""

while Parent do
Path = (Parent.Name .. Path)
Parent = Parent.Parent

if Parent then
Path = ("/" .. Path)
end
end

if SourceScript:IsA("LocalScript") then
Path ..= ".client"
elseif SourceScript:IsA("Script") then
if SourceScript.RunContext == Enum.RunContext.Client then
Path ..= ".client"
else
Path ..= ".server"
end
end

Path ..= ".luau"
end

if Path and LineNumber then
table.insert(StacktraceFrames, 1, {
["function"] = FunctionName,
filename = Path,
abs_path = Path,

lineno = tonumber(LineNumber),
module = (if SourceScript then SourceScript.Name else select(-1, unpack(string.split(Path, ".")))),
module = (if SourceScript then SourceScript.Name else select(-1, unpack(string.split(Path, "/")))),
vars = SanitizeEnvironment(Variables)
})
else
table.insert(StacktraceFrames, 1, {
filename = (if SourceScript then SourceScript:GetFullName() else nil),
filename = Path,
module = Line,
vars = SanitizeEnvironment(Variables)
})
Expand Down

0 comments on commit 4ddac76

Please sign in to comment.