ExceptionServices.Default.cs 1023 B

123456789101112131415161718192021222324252627282930
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. #if HAS_EDI
  3. namespace System.Reactive.PlatformServices
  4. {
  5. //
  6. // WARNING: This code is kept *identically* in two places. One copy is kept in System.Reactive.Core for non-PLIB platforms.
  7. // Another copy is kept in System.Reactive.PlatformServices to enlighten the default lowest common denominator
  8. // behavior of Rx for PLIB when used on a more capable platform.
  9. //
  10. internal class DefaultExceptionServices/*Impl*/ : IExceptionServices
  11. {
  12. public void Rethrow(Exception exception)
  13. {
  14. System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(exception).Throw();
  15. }
  16. }
  17. }
  18. #else
  19. namespace System.Reactive.PlatformServices
  20. {
  21. internal class DefaultExceptionServices : IExceptionServices
  22. {
  23. public void Rethrow(Exception exception)
  24. {
  25. throw exception;
  26. }
  27. }
  28. }
  29. #endif