Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friendly error message for Java not installed #506

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions plugin/teksi_wastewater/teksi_wastewater_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from .gui.twwprofiledockwidget import TwwProfileDockWidget
from .gui.twwsettingsdialog import TwwSettingsDialog
from .gui.twwwizard import TwwWizard
from .libs.modelbaker.iliwrapper.ili2dbutils import JavaNotFoundError
from .processing_provider.provider import TwwProcessingProvider
from .tools.twwmaptools import TwwMapToolConnectNetworkElements, TwwTreeMapTool
from .tools.twwnetwork import TwwGraphManager
Expand Down Expand Up @@ -596,6 +597,7 @@ def actionExportClicked(self):
)

self.interlisImporterExporter = InterlisImporterExporterGui()

except ImportError as e:
self.iface.messageBar().pushMessage(
"Error",
Expand All @@ -605,6 +607,15 @@ def actionExportClicked(self):
self.logger.error(str(e))
return

except JavaNotFoundError as e:
self.iface.messageBar().pushMessage(
"Error",
"Could not load Interlis exporter due to missing Java. See logs for more details.",
level=Qgis.Critical,
)
self.logger.error(str(e))
return

try:
self.interlisImporterExporter.check_dependencies()
except Exception as exception:
Expand Down Expand Up @@ -636,6 +647,15 @@ def actionImportClicked(self):
self.logger.error(str(e))
return

except JavaNotFoundError as e:
self.iface.messageBar().pushMessage(
"Error",
"Could not load Interlis importer due to missing Java. See logs for more details.",
level=Qgis.Critical,
)
self.logger.error(str(e))
return

try:
self.interlisImporterExporter.check_dependencies()
except Exception as exception:
Expand Down