From c3da1f6a5f4e13693a8bdb99cb4de12ceedd6435 Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Mon, 8 Dec 2025 19:22:50 +0100 Subject: [PATCH] Add debug output and improved error handling for talent export process - Included debugging logs for class, talent ID count, and mapper state. - Improved error messages for missing or failed `ConvertAscensionTalentsToCalcFormat` function. - Refined failure messages for unsuccessful talent conversions. --- AscensionExporter/Core.lua | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/AscensionExporter/Core.lua b/AscensionExporter/Core.lua index b867708..f116457 100644 --- a/AscensionExporter/Core.lua +++ b/AscensionExporter/Core.lua @@ -355,7 +355,23 @@ function AE:GenerateMarkdownTalents() -- Convert to calculator format using the mapper local _, class = UnitClass("player") - local buildString = self.ConvertAscensionTalentsToCalcFormat and self.ConvertAscensionTalentsToCalcFormat(ascensionIds, class) + + -- Debug output + table.insert(lines, string.format("*Debug: Class=%s, TalentIDs=%d*\n", tostring(class), #ascensionIds)) + table.insert(lines, string.format("*Debug: Mapper loaded=%s, Function type=%s*\n", + tostring(self._loadedAscensionTalentMapper or false), + tostring(type(self.ConvertAscensionTalentsToCalcFormat)))) + + if not self.ConvertAscensionTalentsToCalcFormat then + table.insert(lines, "*Error: ConvertAscensionTalentsToCalcFormat function not available.*\n") + return table.concat(lines, "\n") + end + + local buildString, err = self.ConvertAscensionTalentsToCalcFormat(ascensionIds, class) + + if err then + table.insert(lines, string.format("*Conversion error: %s*\n", tostring(err))) + end if buildString then -- Generate URL for talent calculator @@ -363,11 +379,11 @@ function AE:GenerateMarkdownTalents() table.insert(lines, string.format("[View in Talent Calculator](%s)\n", url)) -- Embed iframe for Wiki.js - table.insert(lines, string.format('\n", buildString)) + table.insert(lines, string.format('\n', buildString)) return table.concat(lines, "\n") else - table.insert(lines, "*Could not convert talents to calculator format. Only mage class is currently supported.*\n") + table.insert(lines, "*Could not convert talents to calculator format (no build string returned).*\n") return table.concat(lines, "\n") end end