Repository: microsoft/terminal
File: src/cascadia/Remoting/WindowManager.cpp (C++)

Code before:
                        _shouldCreateWindow = true;
                        return;
                    }

                    // Here, we created the new monarch, it wasn't us, so we're
                    // gonna go through the while loop again and ask the new
                    // king.
                    TraceLoggingWrite(g_hRemotingProvider,
                                      "WindowManager_proposeToMonarch_tryAgain",
                                      TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
                                      TraceLoggingKeyword(TIL_KEYWORD_TRACE));
                }
                else
                {
                    TraceLoggingWrite(g_hRemotingProvider,
                                      "WindowManager_proposeToMonarch_unexpectedResultFromKing",
                                      TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
                                      TraceLoggingKeyword(TIL_KEYWORD_TRACE));
                    LOG_CAUGHT_EXCEPTION();
                    throw;
                }
            }
            catch (...)
            {
                // If the monarch (maybe us) failed for _any other reason_ than
                // them dying. This IS quite unexpected. We don't catch
                TraceLoggingWrite(g_hRemotingProvider,
                                  "WindowManager_proposeToMonarch_unexpectedExceptionFromKing",
                                  TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
                                  TraceLoggingKeyword(TIL_KEYWORD_TRACE));

                LOG_CAUGHT_EXCEPTION();
                throw;
            }
        }

        // Here, the monarch (not us) has replied to the message. Get the
        // valuables out of the response:
        _shouldCreateWindow = result.ShouldCreateWindow();
        if (result.Id())
        {
            givenID = result.Id().Value();
        }
        givenName = result.WindowName();

        // TraceLogging doesn't have a good solution for logging an
        // optional. So we have to repeat the calls here:
        if (givenID)
        {
            TraceLoggingWrite(g_hRemotingProvider,
                              "WindowManager_ProposeCommandline",

Review comment (suggestion):
```suggestion
                // them dying. This IS quite unexpected. Let this bubble out. 
```

Code after:
                        _shouldCreateWindow = true;
                        return;
                    }

                    // Here, we created the new monarch, it wasn't us, so we're
                    // gonna go through the while loop again and ask the new
                    // king.
                    TraceLoggingWrite(g_hRemotingProvider,
                                      "WindowManager_proposeToMonarch_tryAgain",
                                      TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
                                      TraceLoggingKeyword(TIL_KEYWORD_TRACE));
                }
                else
                {
                    TraceLoggingWrite(g_hRemotingProvider,
                                      "WindowManager_proposeToMonarch_unexpectedResultFromKing",
                                      TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
                                      TraceLoggingKeyword(TIL_KEYWORD_TRACE));
                    LOG_CAUGHT_EXCEPTION();
                    throw;
                }
            }
            catch (...)
            {
                // If the monarch (maybe us) failed for _any other reason_ than
                // them dying. This IS quite unexpected. Let this bubble out.
                TraceLoggingWrite(g_hRemotingProvider,
                                  "WindowManager_proposeToMonarch_unexpectedExceptionFromKing",
                                  TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
                                  TraceLoggingKeyword(TIL_KEYWORD_TRACE));

                LOG_CAUGHT_EXCEPTION();
                throw;
            }
        }

        // Here, the monarch (not us) has replied to the message. Get the
        // valuables out of the response:
        _shouldCreateWindow = result.ShouldCreateWindow();
        if (result.Id())
        {
            givenID = result.Id().Value();
        }
        givenName = result.WindowName();

        // TraceLogging doesn't have a good solution for logging an
        // optional. So we have to repeat the calls here:
        if (givenID)
        {
            TraceLoggingWrite(g_hRemotingProvider,
                              "WindowManager_ProposeCommandline",