Skip to content

Commit

Permalink
improve dat & dtt error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHeitmann committed Aug 9, 2024
1 parent 64fe56a commit e1fbf5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/stateManagement/openFiles/types/WtaWtpData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ class WtaWtpData extends OpenFileData {
else {
wtpPath = join(datDir, wtpName);
if (!await File(wtpPath!).exists()) {
showToast("Can't find corresponding WTP file");
throw Exception("Can't find corresponding WTP file");
showToast("Can't find corresponding WTP file for $wtaName.wta in ${dttDir ?? datDir}");
throw Exception("Can't find corresponding WTP file for $wtaName");
}
}
}
if (!isWtb && wtpPath == null) {
showToast("Can't find corresponding WTP file");
showToast("Can't find corresponding WTP file in ${dttDir ?? datDir}");
throw Exception("Can't find corresponding WTP file in ${dttDir ?? datDir}");
}

Expand Down
7 changes: 6 additions & 1 deletion lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,12 @@ Future<void> exportDat(String datFolder, { bool checkForNesting = false }) async
}
}
var datExportPath = join(datExportDir, datName);
await repackDat(datFolder, datExportPath);
try {
await repackDat(datFolder, datExportPath);
} catch (e) {
messageLog.add("Failed to export $datName: $e");
rethrow;
}

if (recursive)
await exportDat(datExportDir, checkForNesting: true);
Expand Down

0 comments on commit e1fbf5f

Please sign in to comment.