X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.route%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Froute%2FRouteJob.java;fp=org.simantics.district.route%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Froute%2FRouteJob.java;h=b58f384422162016d071ad9915542537e91f3938;hb=65c53bff95339c4b45e084b7094084be41b060e2;hp=897366ada886f17308fee48caeda0c8e3a043fee;hpb=7e64b34b3cdb452a61d02492d6bbed1e671dc749;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.route/src/org/simantics/district/route/RouteJob.java b/org.simantics.district.route/src/org/simantics/district/route/RouteJob.java index 897366ad..b58f3844 100644 --- a/org.simantics.district.route/src/org/simantics/district/route/RouteJob.java +++ b/org.simantics.district.route/src/org/simantics/district/route/RouteJob.java @@ -8,6 +8,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.osgi.util.NLS; import org.simantics.ObjectIdentitySchedulingRule; import org.simantics.db.Resource; import org.simantics.district.route.internal.Activator; @@ -48,12 +49,15 @@ public class RouteJob extends Job { return Status.OK_STATUS; } } catch (RoutingException e) { - LOGGER.error("Routing failed for waypoints {} and router {}", waypoints, router, e); + LOGGER.error("Routing failed for waypoints {} and router '{}'", waypoints, router, e); callback.completeExceptionally(e); + // This results in UI feedback of the error. + // Perhaps later we get rid of this and let the UI code handle the notifications. + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } } LOGGER.info("No router could calculate route between waypoints {}. Available routers: {}", waypoints, routers); - return Status.OK_STATUS; + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind("No router could calculate route between waypoints {0}. Available routers: {1}", waypoints, routers)); } }