Skip to content

Commit

Permalink
fix: Improve error display for filters. Not perfect, but better.
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Jun 18, 2023
1 parent b5f8605 commit 7ccd09f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion serverpackcreator-gui/src/main/i18n/Gui_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ createserverpack.gui.inclusions.editor.inclusion=Inclusion-Filter:
createserverpack.gui.inclusions.editor.inclusion.info=Regex-expression by which to determine files and directories to include from the specified source.
createserverpack.gui.inclusions.editor.exclusion=Exclusion-Filter:
createserverpack.gui.inclusions.editor.exclusion.info=Regex-expression by which to determine files and directories to exclude from the specified source.
createserverpack.gui.inclusions.editor.filter.error=Invalid regex: {0}
createserverpack.gui.inclusions.editor.filter.error=Invalid regex:<br>{0}
createserverpack.gui.inclusions.editor.add=Add a new entry
createserverpack.gui.inclusions.editor.delete=Delete selected entry
createserverpack.gui.inclusions.editor.tip.default=Select an entry on the left to see what would be included!\nThis panel will be filled with a list of all files that would match the source, taking any filters into account.\nThink of it as a preview and check at the same time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,12 @@ class InclusionsEditor(
inclusionInfo.info()
} catch (ex: PatternSyntaxException) {
timer.stop()
inclusionInfo.error(Gui.createserverpack_gui_inclusions_editor_filter_error(ex.description))
var exception = ex.message ?: ex.description
exception = exception
.replace("\t","%20")
.replace("\n","<br>")
.replace(" ","&nbsp;")
inclusionInfo.error("<html>${Gui.createserverpack_gui_inclusions_editor_filter_error(exception)}</html>")
}
}

Expand All @@ -277,7 +282,12 @@ class InclusionsEditor(
exclusionInfo.info()
} catch (ex: PatternSyntaxException) {
timer.stop()
exclusionInfo.error(Gui.createserverpack_gui_inclusions_editor_filter_error(ex.description))
var exception = ex.message ?: ex.description
exception = exception
.replace("\t","&nbsp;&nbsp;&nbsp;&nbsp;")
.replace("\n","<br>")
.replace(" ","&nbsp;")
exclusionInfo.error("<html>${Gui.createserverpack_gui_inclusions_editor_filter_error(exception)}</html>")
}
}

Expand Down

0 comments on commit 7ccd09f

Please sign in to comment.