#19 Implement [ 1799638 ] Improve Error Messaging

closed-accepted
nobody
None
5
2011-02-13
2007-09-22
Kirill
No

To improve error reporting on failed opening of a console window:

1. replace IDS_TAB_CREATE_FAILED with "Failed to open %s tab!\nThe process %s could still be running (use the Task Manager to find it and end it)"
2. add the following to
if (hwndConsoleView == NULL)
block in MainFrame::CreateNewConsole:

// copied from ConsoleView::OnCreate
wstring strShell;
shared_ptr<TabData> tabData = g_settingsHandler->GetTabSettings().tabDataVector[dwTabIndex];
if (strDbgCmdLine.length() > 0)
{
strShell = strDbgCmdLine;
}
else if (tabData->strShell.length() > 0)
{
strShell = tabData->strShell;
}
// end of copy from ConsoleView::OnCreate

strMessage.Format(IDS_TAB_CREATE_FAILED, g_settingsHandler->GetTabSettings().tabDataVector[dwTabIndex]->strTitle.c_str(), strShell.c_str());

Disclaimer: I'm not familiar enough with the code to be sure that the copied part of ConsoleView::OnCreate is not implemented in more elegant way somewhere.

Marko, do you think we can do something like http://msdn2.microsoft.com/en-us/library/ms686722.aspx when ConsoleHandler::StartShellProcess did CreateProcess successfully, but failed to InjectHookDLL?

At the same time, can we add ::Message box to the Run(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWDEFAULT) at line 155 (fail to load the settings)?

Discussion

  • Kirill
    Kirill
    2011-02-13

    • status: open --> closed-accepted