r1295@opsdev009 (orig r69995): cpiro | 2007-11-14 22:26:28 -0800
[amiethrift.git] / lib / erl / src / transport / tTransportException.erl
blobb7dc43d2131c7e20445794165148b3ecd997eec7
1 %%% Copyright (c) 2007- Facebook
2 %%% Distributed under the Thrift Software License
3 %%%
4 %%% See accompanying file LICENSE or visit the Thrift site at:
5 %%% http://developers.facebook.com/thrift/
7 -module(tTransportException).
9 -include("oop.hrl").
11 -include("thrift.hrl").
12 -include("transport/tTransportException.hrl").
14 -behavior(oop).
16 -export([attr/4, super/0, inspect/1]).
18 -export([new/0, new/1, new/2]).
20 %%%
21 %%% define attributes
22 %%% 'super' is required unless ?MODULE is a base class
23 %%%
25 ?DEFINE_ATTR(super);
26 ?DEFINE_ATTR(type).
28 %%%
29 %%% behavior callbacks
30 %%%
32 %%% super() -> SuperModule = atom()
33 %%% | none
35 super() ->
36 tException.
38 %%% inspect(This) -> string()
40 inspect(This) ->
41 ?FORMAT_ATTR(type).
43 %%%
44 %%% class methods
45 %%%
47 new(Type, Message) ->
48 Super = (super()):new(Message),
49 #?MODULE{super=Super, type=Type}.
51 new() ->
52 new(?tTransportException_UNKNOWN, undefined).
53 new(Type) ->
54 new(Type, undefined).
56 %%%
57 %%% instance methods
58 %%%