Skip to content

Commit ca33f0b

Browse files
authored
Merge pull request #3606 from Vogel612/some-critical-bugs
Prevent silent crash at startup.
2 parents ae19b66 + 330241e commit ca33f0b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

RetailCoder.VBE/Extension.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,13 @@ private void InitializeAddIn()
191191
catch (Exception exception)
192192
{
193193
_logger.Fatal(exception);
194-
System.Windows.Forms.MessageBox.Show(exception.ToString(), RubberduckUI.RubberduckLoadFailure,
195-
MessageBoxButtons.OK, MessageBoxIcon.Error);
194+
System.Windows.Forms.MessageBox.Show(
195+
#if DEBUG
196+
exception.ToString(),
197+
#else
198+
exception.Message.ToString(),
199+
#endif
200+
RubberduckUI.RubberduckLoadFailure, MessageBoxButtons.OK, MessageBoxIcon.Error);
196201
}
197202
finally
198203
{
@@ -214,13 +219,14 @@ private void Startup()
214219
_app.Startup();
215220

216221
_isInitialized = true;
217-
218222
}
219223
catch (Exception e)
220224
{
221225
_logger.Log(LogLevel.Fatal, e, "Startup sequence threw an unexpected exception.");
222226
#if DEBUG
223-
throw; // <<~ uncomment to crash the process
227+
throw;
228+
#else
229+
throw new Exception("Rubberduck's startup sequence threw an unexpected exception. Please check the Rubberduck logs for more information and report an issue if necessary");
224230
#endif
225231
}
226232
}

0 commit comments

Comments
 (0)