This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 268153
Collapse All | Expand All

(-)a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/ProcessUtils.java (-4 / +5 lines)
Lines 67-72 Link Here
67
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
67
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
68
import org.netbeans.modules.nativeexecution.api.NativeProcess;
68
import org.netbeans.modules.nativeexecution.api.NativeProcess;
69
import org.netbeans.modules.nativeexecution.api.NativeProcessBuilder;
69
import org.netbeans.modules.nativeexecution.api.NativeProcessBuilder;
70
import org.netbeans.modules.nativeexecution.support.MiscUtils;
70
import org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService;
71
import org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService;
71
import org.openide.util.Exceptions;
72
import org.openide.util.Exceptions;
72
import org.openide.util.RequestProcessor;
73
import org.openide.util.RequestProcessor;
Lines 589-598 Link Here
589
            }
590
            }
590
            result = new ExitStatus(process.waitFor(), output.get(), (error == null) ? null : error.get());
591
            result = new ExitStatus(process.waitFor(), output.get(), (error == null) ? null : error.get());
591
        } catch (InterruptedException ex) {
592
        } catch (InterruptedException ex) {
592
            result = new ExitStatus(-100, null, Arrays.asList(ex.getMessage().split("\n"))); //NOI18N
593
            result = new ExitStatus(-100, null, MiscUtils.getMessageAsList(ex));
593
        } catch (Throwable th) {
594
        } catch (Throwable th) {
594
            org.netbeans.modules.nativeexecution.support.Logger.getInstance().log(Level.INFO, th.getMessage(), th);
595
            org.netbeans.modules.nativeexecution.support.Logger.getInstance().log(Level.INFO, th.getMessage(), th);
595
            result = new ExitStatus(-200, null, Arrays.asList(th.getMessage().split("\n"))); //NOI18N
596
            result = new ExitStatus(-200, null, MiscUtils.getMessageAsList(th));
596
        }
597
        }
597
598
598
        return result;
599
        return result;
Lines 655-664 Link Here
655
            }
656
            }
656
            result = new ExitStatus(process.waitFor(), output.get(), (error == null) ? null : error.get());
657
            result = new ExitStatus(process.waitFor(), output.get(), (error == null) ? null : error.get());
657
        } catch (InterruptedException ex) {
658
        } catch (InterruptedException ex) {
658
            result = new ExitStatus(-100, null, Arrays.asList(ex.getMessage().split("\n")));
659
            result = new ExitStatus(-100, null, MiscUtils.getMessageAsList(ex));
659
        } catch (Throwable th) {
660
        } catch (Throwable th) {
660
            org.netbeans.modules.nativeexecution.support.Logger.getInstance().log(Level.INFO, th.getMessage(), th);
661
            org.netbeans.modules.nativeexecution.support.Logger.getInstance().log(Level.INFO, th.getMessage(), th);
661
            result = new ExitStatus(-200, null, Arrays.asList(th.getMessage().split("\n")));
662
            result = new ExitStatus(-200, null, MiscUtils.getMessageAsList(th));
662
        }
663
        }
663
664
664
        return result;
665
        return result;
(-)a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/support/MiscUtils.java (+12 lines)
Lines 44-49 Link Here
44
import com.jcraft.jsch.ChannelSftp;
44
import com.jcraft.jsch.ChannelSftp;
45
import com.jcraft.jsch.JSchException;
45
import com.jcraft.jsch.JSchException;
46
import com.jcraft.jsch.SftpException;
46
import com.jcraft.jsch.SftpException;
47
import java.util.Arrays;
48
import java.util.Collections;
49
import java.util.List;
47
import org.netbeans.modules.nativeexecution.spi.support.NativeExecutionUserNotification;
50
import org.netbeans.modules.nativeexecution.spi.support.NativeExecutionUserNotification;
48
import org.openide.util.ImageUtilities;
51
import org.openide.util.ImageUtilities;
49
import org.openide.util.NbBundle;
52
import org.openide.util.NbBundle;
Lines 95-98 Link Here
95
        // well, let's be conservative
98
        // well, let's be conservative
96
        return e.id != ChannelSftp.SSH_FX_NO_SUCH_FILE && e.id != ChannelSftp.SSH_FX_PERMISSION_DENIED;
99
        return e.id != ChannelSftp.SSH_FX_NO_SUCH_FILE && e.id != ChannelSftp.SSH_FX_PERMISSION_DENIED;
97
    }
100
    }
101
102
    public static List<String> getMessageAsList(Throwable ex) {
103
        String msg = ex.getMessage();
104
        if (msg == null) {
105
            return Collections.emptyList();
106
        } else {
107
            return Arrays.asList(msg.split("\n")); //NOI18N
108
        }
109
    }
98
}
110
}
(-)a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/support/ShellSession.java (-1 / +1 lines)
Lines 166-172 Link Here
166
                        }
166
                        }
167
                    } catch (InterruptedException ex) {
167
                    } catch (InterruptedException ex) {
168
                        Thread.currentThread().interrupt();
168
                        Thread.currentThread().interrupt();
169
                        return new ExitStatus(-1, null, Arrays.asList(ex.getMessage().split("\n"))); // NOI18N
169
                        return new ExitStatus(-1, null, MiscUtils.getMessageAsList(ex));
170
                    }
170
                    }
171
                }
171
                }
172
            }
172
            }

Return to bug 268153