Last active
March 3, 2018 11:01
-
-
Save hecres/1d0fbe3fafaef532f5fcd7e408b6bedd to your computer and use it in GitHub Desktop.
UniRxへのExceptionDispatchInfo導入
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// メソッドの場合 | |
public void OnError(Exception error) | |
{ | |
ExceptionDispatchInfo.Capture(error).Throw(); | |
} | |
// Actionデリゲートの場合 | |
public static readonly Action<Exception> Throw = ex => { ExceptionDispatchInfo.Capture(ex).Throw(); }; | |
public static readonly Action<Exception, T> Throw = (ex, _) => { ExceptionDispatchInfo.Capture(ex).Throw(); }; | |
public static readonly Action<Exception, T1, T2> Throw = (ex, _, __) => { ExceptionDispatchInfo.Capture(ex).Throw(); }; | |
public static readonly Action<Exception, T1, T2, T3> Throw = (ex, _, __, ___) => { ExceptionDispatchInfo.Capture(ex).Throw(); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment