@@ -27,7 +27,7 @@ public InitializationOptions GenerateAuthenticationOptions(string profile)
27
27
}
28
28
catch ( Exception e )
29
29
{
30
- var reason = $ "{ e . Message } ({ e . InnerException ? . Message } )";
30
+ var reason = e . InnerException == null ? e . Message : $ "{ e . Message } ({ e . InnerException . Message } )";
31
31
m_UnityServiceErrorMessagePublisher . Publish ( new UnityServiceErrorMessage ( "Authentication Error" , reason , UnityServiceErrorMessage . Service . Authentication , e ) ) ;
32
32
throw ;
33
33
}
@@ -46,7 +46,7 @@ public async Task InitializeAndSignInAsync(InitializationOptions initializationO
46
46
}
47
47
catch ( Exception e )
48
48
{
49
- var reason = $ "{ e . Message } ({ e . InnerException ? . Message } )";
49
+ var reason = e . InnerException == null ? e . Message : $ "{ e . Message } ({ e . InnerException . Message } )";
50
50
m_UnityServiceErrorMessagePublisher . Publish ( new UnityServiceErrorMessage ( "Authentication Error" , reason , UnityServiceErrorMessage . Service . Authentication , e ) ) ;
51
51
throw ;
52
52
}
@@ -67,7 +67,7 @@ public async Task SwitchProfileAndReSignInAsync(string profile)
67
67
}
68
68
catch ( Exception e )
69
69
{
70
- var reason = $ "{ e . Message } ({ e . InnerException ? . Message } )";
70
+ var reason = e . InnerException == null ? e . Message : $ "{ e . Message } ({ e . InnerException . Message } )";
71
71
m_UnityServiceErrorMessagePublisher . Publish ( new UnityServiceErrorMessage ( "Authentication Error" , reason , UnityServiceErrorMessage . Service . Authentication , e ) ) ;
72
72
throw ;
73
73
}
@@ -87,7 +87,7 @@ public async Task<bool> EnsurePlayerIsAuthorized()
87
87
}
88
88
catch ( AuthenticationException e )
89
89
{
90
- var reason = $ "{ e . Message } ({ e . InnerException ? . Message } )";
90
+ var reason = e . InnerException == null ? e . Message : $ "{ e . Message } ({ e . InnerException . Message } )";
91
91
m_UnityServiceErrorMessagePublisher . Publish ( new UnityServiceErrorMessage ( "Authentication Error" , reason , UnityServiceErrorMessage . Service . Authentication , e ) ) ;
92
92
93
93
//not rethrowing for authentication exceptions - any failure to authenticate is considered "handled failure"
@@ -96,7 +96,7 @@ public async Task<bool> EnsurePlayerIsAuthorized()
96
96
catch ( Exception e )
97
97
{
98
98
//all other exceptions should still bubble up as unhandled ones
99
- var reason = $ "{ e . Message } ({ e . InnerException ? . Message } )";
99
+ var reason = e . InnerException == null ? e . Message : $ "{ e . Message } ({ e . InnerException . Message } )";
100
100
m_UnityServiceErrorMessagePublisher . Publish ( new UnityServiceErrorMessage ( "Authentication Error" , reason , UnityServiceErrorMessage . Service . Authentication , e ) ) ;
101
101
throw ;
102
102
}
0 commit comments