Exemplo n.º 1
0
 private static object TryGenerateCreate(Type protocol, Actor actor, IMailbox mailbox, string targetClassName, string lookupTypeName)
 {
     try
     {
         var generator = ProxyGenerator.ForMain(true, actor.Logger);
         return TryGenerateCreate(protocol, actor, mailbox, generator, targetClassName, lookupTypeName);
     }
     catch (Exception)
     {
         try
         {
             var generator = ProxyGenerator.ForTest(true, actor.Logger);
             return TryGenerateCreate(protocol, actor, mailbox, generator, targetClassName, lookupTypeName);
         }
         catch (Exception etest)
         {
             throw new ArgumentException($"Actor proxy {protocol.Name} not created for main or test: {etest.Message}", etest);
         }
     }
 }
Exemplo n.º 2
0
 private static object TryGenerateCreate(Type protocol, Actor actor, IMailbox mailbox, string targetClassName, string lookupTypeName)
 {
     try
     {
         var generator = ProxyGenerator.ForMain(true, actor.Logger);
         return(TryGenerateCreate(protocol, actor, mailbox, generator, targetClassName, lookupTypeName));
     }
     catch (Exception e)
     {
         actor.Logger.Error($"Trying generate proxy but it failed because of '{e.Message}' but still trying", e);
         try
         {
             var generator = ProxyGenerator.ForTest(true, actor.Logger);
             return(TryGenerateCreate(protocol, actor, mailbox, generator, targetClassName, lookupTypeName));
         }
         catch (Exception etest)
         {
             throw new ArgumentException($"Actor proxy {protocol.Name} not created for main or test: {etest.Message}", etest);
         }
     }
 }