mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
Handle connection errors properly, displaying the error message
This commit is contained in:
@@ -514,9 +514,7 @@ namespace renderdocui.Code
|
||||
// if the renderer isn't running, we hit a failure case so display an error message
|
||||
if (!m_Renderer.Running)
|
||||
{
|
||||
string errmsg = "Unknown error message";
|
||||
if (m_Renderer.InitException.Data.Contains("status"))
|
||||
errmsg = ((ReplayCreateStatus)m_Renderer.InitException.Data["status"]).Str();
|
||||
string errmsg = m_Renderer.InitException.Status.Str();
|
||||
|
||||
MessageBox.Show(String.Format("{0}\nFailed to open file for replay: {1}.\n\n" +
|
||||
"Check diagnostic log in Help menu for more details.", origFilename, errmsg),
|
||||
|
||||
@@ -1186,7 +1186,13 @@ namespace renderdocui.Windows
|
||||
? global::renderdocui.Properties.Resources.connect
|
||||
: global::renderdocui.Properties.Resources.disconnect;
|
||||
|
||||
if (host.VersionMismatch)
|
||||
if (m_Core.Renderer.InitException != null)
|
||||
{
|
||||
contextChooser.Image = global::renderdocui.Properties.Resources.cross;
|
||||
contextChooser.Text = "Replay Context: Local";
|
||||
statusText.Text = "Connection failed: " + m_Core.Renderer.InitException.Status.Str();
|
||||
}
|
||||
else if (host.VersionMismatch)
|
||||
{
|
||||
statusText.Text = "Remote server is not running RenderDoc " + VersionString;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user