File tree Expand file tree Collapse file tree 3 files changed +45
-13
lines changed
EuNet.Unity/Assets/Plugins/EuNet/Runtime Expand file tree Collapse file tree 3 files changed +45
-13
lines changed Original file line number Diff line number Diff line change @@ -440,17 +440,33 @@ public void Close()
440440
441441 internal void OnSessionConnected ( )
442442 {
443- State = SessionState . Connected ;
444- OnConnected ? . Invoke ( ) ;
443+ try
444+ {
445+ State = SessionState . Connected ;
446+ OnConnected ? . Invoke ( ) ;
447+ }
448+ catch ( Exception ex )
449+ {
450+ _logger . LogError ( ex , ex . Message ) ;
451+ }
445452 }
446453
447454 internal bool OnSessionClosed ( )
448455 {
449- if ( State != SessionState . Connected )
450- return false ;
456+ try
457+ {
458+ if ( State != SessionState . Connected )
459+ return false ;
451460
452- State = SessionState . Closed ;
453- OnClosed ? . Invoke ( ) ;
461+ State = SessionState . Closed ;
462+
463+ OnClosed ? . Invoke ( ) ;
464+ }
465+ catch ( Exception ex )
466+ {
467+ _logger . LogError ( ex , ex . Message ) ;
468+ }
469+
454470 return true ;
455471 }
456472
Original file line number Diff line number Diff line change @@ -440,17 +440,33 @@ public void Close()
440440
441441 internal void OnSessionConnected ( )
442442 {
443- State = SessionState . Connected ;
444- OnConnected ? . Invoke ( ) ;
443+ try
444+ {
445+ State = SessionState . Connected ;
446+ OnConnected ? . Invoke ( ) ;
447+ }
448+ catch ( Exception ex )
449+ {
450+ _logger . LogError ( ex , ex . Message ) ;
451+ }
445452 }
446453
447454 internal bool OnSessionClosed ( )
448455 {
449- if ( State != SessionState . Connected )
450- return false ;
456+ try
457+ {
458+ if ( State != SessionState . Connected )
459+ return false ;
451460
452- State = SessionState . Closed ;
453- OnClosed ? . Invoke ( ) ;
461+ State = SessionState . Closed ;
462+
463+ OnClosed ? . Invoke ( ) ;
464+ }
465+ catch ( Exception ex )
466+ {
467+ _logger . LogError ( ex , ex . Message ) ;
468+ }
469+
454470 return true ;
455471 }
456472
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public UnityDebugLogger()
1313
1414 public void LogError ( Exception e , string msg )
1515 {
16- Debug . LogError ( msg ) ;
16+ Debug . LogException ( e ) ;
1717 }
1818
1919 public void LogError ( string msg )
You can’t perform that action at this time.
0 commit comments