indent(out) << "public " << (is_final ? "sealed " : "") << "partial class " << tstruct->get_name() << " : ";
if (is_exception) {
- out << "Exception, ";
+ out << "TException, ";
}
out << "TBase";
indent(out) << "public override void Write(TProtocol protocol) {" << endl;
indent_up();
- indent(out) << "throw new Exception(\"Cannot persist an union type which is not set.\");" << endl;
+ indent(out) << "throw new TProtocolException( TProtocolException.INVALID_DATA, \"Cannot persist an union type which is not set.\");" << endl;
indent_down();
indent(out) << "}" << endl << endl;
namespace Thrift.Protocol
{
- public class TProtocolException : Exception
+ public class TProtocolException : TException
{
public const int UNKNOWN = 0;
public const int INVALID_DATA = 1;
namespace Thrift
{
- public class TApplicationException : Exception
+ public class TApplicationException : TException
{
protected ExceptionType type;
--- /dev/null
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ * Contains some contributions under the Thrift Software License.
+ * Please see doc/old-thrift-license.txt in the Thrift distribution for
+ * details.
+ */
+
+using System;
+
+namespace Thrift
+{
+ public class TException : Exception
+ {
+ public TException()
+ {
+ }
+
+ public TException( string message)
+ : base(message)
+ {
+ }
+
+ }
+}
<Compile Include="Protocol\TSet.cs" />
<Compile Include="Protocol\TStruct.cs" />
<Compile Include="Protocol\TType.cs" />
+ <Compile Include="TException.cs" />
<Compile Include="TApplicationException.cs" />
<Compile Include="TProcessor.cs" />
<Compile Include="Transport\TFramedTransport.cs" />
<Compile Include="Server\TServer.cs" />\r
<Compile Include="Server\TSimpleServer.cs" />\r
<Compile Include="Server\TThreadPoolServer.cs" />\r
+ <Compile Include="TException.cs" />\r
<Compile Include="TApplicationException.cs" />\r
<Compile Include="TProcessor.cs" />\r
<Compile Include="Transport\TBufferedTransport.cs" />\r
namespace Thrift.Transport
{
- public class TTransportException : Exception
+ public class TTransportException : TException
{
protected ExceptionType type;