From 0807b8fb86e225f734f1cec664bcee3be6943da7 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Sun, 16 Feb 2025 19:40:22 +0100 Subject: [PATCH] add debug to data parser --- src/App.vue | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index dc89f8b..ce2ad38 100644 --- a/src/App.vue +++ b/src/App.vue @@ -129,21 +129,33 @@ export default defineComponent({ for (const nodeData of nodes) { const job = jobFromString(nodeData.job); - if (job === null) continue; + if (job === null) { + console.debug(`Failed to parse job: ${nodeData.job}`); + continue; + } const nodeType = nodeTypeFromString(nodeData.type); - if (nodeType === null) continue; + if (nodeType === null) { + console.debug(`Failed to parse node type: ${nodeData.type}`); + continue; + } const items = [] as Item[]; for (const itemId of nodeData.items) { const item = this.items[itemId]; - if (item === undefined) continue; + if (item === undefined) { + console.debug(`Failed to find item with id: ${itemId}`); + continue; + } items.push(item); } const times = [] as TimeRange[]; for (const timeRangeEntry of nodeData.times) { const timeSplit = timeRangeEntry.split("-"); - if (timeSplit.length !== 2) continue; + if (timeSplit.length !== 2) { + console.debug(`Failed to parse time range: ${timeRangeEntry}`); + continue; + } const startTime = timeSplit[0].split(":"); const endTime = timeSplit[1].split(":"); times.push(new TimeRange( @@ -155,7 +167,10 @@ export default defineComponent({ } const nearestAetheryte = this.findNearestAetheryte(nodeData?.position?.zone, nodeData?.position?.x, nodeData.position?.y); - if (nearestAetheryte === null) continue; + if (nearestAetheryte === null) { + console.debug(`Failed to find nearest aetheryte for node: ${JSON.stringify(nodeData)}`); + continue; + } this.nodes.push(new Node( job,