コード例 #1
0
            public Task <Xtruct> testMultiException(string arg0, string arg1, CancellationToken cancellationToken)
            {
                logger.Invoke("testMultiException({0}, {1})", arg0, arg1);
                if (arg0 == "Xception")
                {
                    var x = new Xception
                    {
                        ErrorCode = 1001,
                        Message   = "This is an Xception"
                    };
                    throw x;
                }

                if (arg0 == "Xception2")
                {
                    var x = new Xception2
                    {
                        ErrorCode    = 2002,
                        Struct_thing = new Xtruct {
                            String_thing = "This is an Xception2"
                        }
                    };
                    throw x;
                }

                var result = new Xtruct {
                    String_thing = arg1
                };

                return(Task.FromResult(result));
            }
コード例 #2
0
ファイル: Xception.cs プロジェクト: ste93/yarp
        public Xception DeepCopy()
        {
            var tmp63 = new Xception();

            if (__isset.errorCode)
            {
                tmp63.ErrorCode = this.ErrorCode;
            }
            tmp63.__isset.errorCode = this.__isset.errorCode;
            if ((Message != null) && __isset.message)
            {
                tmp63.Message = this.Message;
            }
            tmp63.__isset.message = this.__isset.message;
            return(tmp63);
        }
コード例 #3
0
 public Task testException(string arg, CancellationToken cancellationToken)
 {
     logger.Invoke("testException({0})", arg);
     if (arg == "Xception")
     {
         var x = new Xception
         {
             ErrorCode = 1001,
             Message   = arg
         };
         throw x;
     }
     if (arg == "TException")
     {
         throw new TException();
     }
     return(Task.CompletedTask);
 }