File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/org/scijava/platform Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3333import java .net .URL ;
3434
3535import org .scijava .Priority ;
36+ import org .scijava .log .LogService ;
37+ import org .scijava .plugin .Parameter ;
3638import org .scijava .plugin .Plugin ;
3739
3840/**
4446@ Plugin (type = Platform .class , name = "Default" , priority = Priority .VERY_LOW )
4547public class DefaultPlatform extends AbstractPlatform {
4648
49+ @ Parameter (required = false )
50+ private LogService log ;
51+
4752 // -- PlatformHandler methods --
4853
4954 /**
@@ -66,9 +71,14 @@ public void open(final URL url) throws IOException {
6671 try {
6772 final int exitCode = getPlatformService ().exec (browser , url .toString ());
6873 if (exitCode == 0 ) return ;
74+ else if (log != null ) {
75+ log .debug ("Command '" + browser +
76+ "' failed with exit code " + exitCode );
77+ }
6978 }
7079 catch (final IOException e ) {
7180 // browser executable was invalid; try the next one
81+ if (log != null ) log .debug ("Command '" + browser + "' failed" , e );
7282 }
7383 }
7484 throw new IOException ("Could not open " + url );
You can’t perform that action at this time.
0 commit comments