Cleanup error messages; more descriptive and appropriate.
git-svn-id: file:///home/svn/framework3/trunk@13021 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
73137c8dc1
commit
b70eeec942
|
@ -116,7 +116,7 @@ public class MainFrame extends FrameView {
|
|||
connectRpc();
|
||||
getFrame().addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
if(!confirmStop())
|
||||
if(!MsfguiApp.shuttingDown && !confirmStop())
|
||||
throw new RuntimeException("Closing aborted.");
|
||||
}
|
||||
});
|
||||
|
@ -137,13 +137,13 @@ public class MainFrame extends FrameView {
|
|||
return true;
|
||||
try {
|
||||
int choice = JOptionPane.showConfirmDialog(getFrame(), "Stop msfrpcd?");
|
||||
if(choice != JOptionPane.YES_OPTION && choice != JOptionPane.NO_OPTION)
|
||||
return false;
|
||||
MsfguiApp.shuttingDown = true;
|
||||
if(choice == JOptionPane.YES_OPTION)
|
||||
rpcConn.execute("core.stop");
|
||||
else if(choice == JOptionPane.NO_OPTION)
|
||||
rpcConn.execute("auth.logout");
|
||||
else
|
||||
return false;
|
||||
MsfguiApp.shuttingDown = true;
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package msfgui;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
import org.jdesktop.application.Action;
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,6 +60,12 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
|||
if(mex.getMessage().toLowerCase().contains("authentication error"))
|
||||
mainframe.statusAnimationLabel.setText("Error authenticating; msfrpcd is running "
|
||||
+"but you did not enter the right credentials.");
|
||||
else if (mex.getMessage().toLowerCase().contains("connection reset"))
|
||||
mainframe.statusAnimationLabel.setText("Connection reset; is the SSL option correct?"
|
||||
+ " Is msfrpcd running on the right port?");
|
||||
else if (mex.getMessage().toLowerCase().contains("timed out"))
|
||||
mainframe.statusAnimationLabel.setText("Timeout; is the SSL option correct?"
|
||||
+ " Is msfrpcd running on the right port?");
|
||||
} catch (NullPointerException nex) {//generated when attributes dont exist.
|
||||
}
|
||||
//Darn. open the gui anyway
|
||||
|
|
|
@ -197,9 +197,11 @@ public class RpcConnection {
|
|||
ex = ex2;
|
||||
}
|
||||
if(! (ex instanceof MsfException)){
|
||||
if(! MsfguiApp.shuttingDown || !ex.getLocalizedMessage().toLowerCase().contains("broken pipe")){
|
||||
ex.printStackTrace();
|
||||
throw new MsfException("Error in call: "+ex.getLocalizedMessage(), ex);
|
||||
}
|
||||
}
|
||||
throw (MsfException)ex;
|
||||
}
|
||||
}
|
||||
|
@ -423,6 +425,14 @@ public class RpcConnection {
|
|||
mex.printStackTrace();
|
||||
setMessage("Cannot connect to started msfrpcd.");
|
||||
throw mex;
|
||||
}else if(mex.getMessage().toLowerCase().contains("connection reset")){
|
||||
mex.printStackTrace();
|
||||
setMessage("Connection reset.");
|
||||
throw mex;
|
||||
}else if(mex.getMessage().toLowerCase().contains("timed out")){
|
||||
mex.printStackTrace();
|
||||
setMessage("Timeout.");
|
||||
throw mex;
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue