Skip to content

Commit 330241e

Browse files
committed
Fail more loudly on startup
instead of just rethrowing, we throw a more userfriendly exception in RELEASE builds though. Fixes #3563
1 parent dbcbc84 commit 330241e

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
@@ -193,8 +193,13 @@ private void InitializeAddIn()
193193
catch (Exception exception)
194194
{
195195
_logger.Fatal(exception);
196-
System.Windows.Forms.MessageBox.Show(exception.ToString(), RubberduckUI.RubberduckLoadFailure,
197-
MessageBoxButtons.OK, MessageBoxIcon.Error);
196+
System.Windows.Forms.MessageBox.Show(
197+
#if DEBUG
198+
exception.ToString(),
199+
#else
200+
exception.Message.ToString(),
201+
#endif
202+
RubberduckUI.RubberduckLoadFailure, MessageBoxButtons.OK, MessageBoxIcon.Error);
198203
}
199204
finally
200205
{
@@ -216,13 +221,14 @@ private void Startup()
216221
_app.Startup();
217222

218223
_isInitialized = true;
219-
220224
}
221225
catch (Exception e)
222226
{
223227
_logger.Log(LogLevel.Fatal, e, "Startup sequence threw an unexpected exception.");
224228
#if DEBUG
225-
throw; // <<~ uncomment to crash the process
229+
throw;
230+
#else
231+
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");
226232
#endif
227233
}
228234
}

0 commit comments

Comments
 (0)