Error tracking with Sentry on Roblox

Sentry should only log the errors from the main game, not studio.

This might just be inexperienced me talking, but don’t you just wait to publish the game until you are sure there is a minimal amount of errors?. Also, I get how 10k is a low number, but 100k sounds reasonable, seeing as you might want a lot fewer errors. If you could show me an example of what kind of errors you are getting, I would love to see it :slight_smile:

I just wanted you to know how grateful I am for your reply. I haven’t previously heard of the GitHub Student Developer Pack anywhere else. They have so many great opportunities on there. Thanks for posting about it.

1 Like

It basically means that the error log on sentry will only show the error message. For an actual traceback with script names, line numbers, and function names you need to find and replace the function “StringTraceToTable” with this:

local function StringTraceToTable(trace)
	local stacktrace = {}
	
	for line in trace:gmatch("[^\n\r]+") do
		if (not line:match("^Stack Begin$") and not line:match("^Stack End$")) then
			local path, lineNum, func = line:match("(.*), line (%d+)%s*-?%s*(.*)")
			
			if (path and lineNum and func) then
				table.insert(stacktrace, 1, {
					filename = path;
					["function"] = func;
					lineno = tonumber(lineNum);
				})
			else
				return false, "invalid traceback"
			end
		end
	end

	if (#stacktrace == 0) then
		return false, "invalid traceback"
	end

	local sorted = {}
	for i = #stacktrace, 1, -1 do
		sorted[i] = stacktrace[i]
	end

	return true, sorted
end

This is also my server error event handler if it helps anyone:

ScriptContext.Error:Connect(function(message, trace)
	client:SendException(Raven.ExceptionType.Server, message, trace)
end)

now with the new official roblox error reports, sentry no longer needs to be relied on.