# HG changeset patch # User Ed Swartz # Date 1262738161 21600 # Node ID 51d63d83aad194d92412786c4b8bf4349836ee41 # Parent 78fd666a897a47376e719d0662ac7c6bb155c904 Don't log exception to console when sbs[.bat] cannot be found. diff -r 78fd666a897a -r 51d63d83aad1 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Tue Jan 05 11:23:50 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Tue Jan 05 18:36:01 2010 -0600 @@ -18,6 +18,7 @@ import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -636,17 +637,29 @@ sbsV2Version = new Version(0, 0, 0); Runtime rt=Runtime.getRuntime(); + IPath sbsPath = SBSv2Utils.getSBSPath(); + Process p = null; try { - IPath sbsPath = SBSv2Utils.getSBSPath(); - Process p = rt.exec(new String[] { sbsPath.toOSString(), "-v" }); - + p = rt.exec(new String[] { sbsPath.toOSString(), "-v" }); + } catch (IOException e) { + // no such process, SBSv2 not available + Logging.log(SDKCorePlugin.getDefault(), Logging.newSimpleStatus( + 0, IStatus.WARNING, + MessageFormat.format( + "Could not find or launch Raptor script ''{0}''; SBSv2 support will not be available", + sbsPath), e)); + } + if (p != null) { BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String overallOutput = null; String stdErrLine = null; - while ((stdErrLine = br.readLine()) != null) { - overallOutput += stdErrLine; + try { + while ((stdErrLine = br.readLine()) != null) { + overallOutput += stdErrLine; + } + } catch (IOException e) { + e.printStackTrace(); } - if (overallOutput != null) { { String[] tokens = overallOutput.split(" "); @@ -674,14 +687,9 @@ } p.destroy(); + } } } - } catch (IOException e) { - e.printStackTrace(); - } - - - } return sbsV2Version; }