blob: 84833a826885e10716a26eaef35494ba6490d91a [file] [log] [blame]
Christopher Piro094823a2007-07-18 00:26:12 +00001%%% Copyright (c) 2007- Facebook
2%%% Distributed under the Thrift Software License
Christopher Pirode11d852007-11-18 02:10:20 +00003%%%
Christopher Piro094823a2007-07-18 00:26:12 +00004%%% See accompanying file LICENSE or visit the Thrift site at:
5%%% http://developers.facebook.com/thrift/
6
7-module(tProtocolException).
8
9-include("oop.hrl").
10
11-include("thrift.hrl").
12-include("protocol/tProtocolException.hrl").
13
14-behavior(oop).
15
16-export([attr/4, super/0, inspect/1]).
17
18-export([new/0, new/1, new/2]).
19
20%%%
21%%% define attributes
22%%% 'super' is required unless ?MODULE is a base class
23%%%
24
Christopher Pirode11d852007-11-18 02:10:20 +000025?DEFINE_ATTR(super).
26
Christopher Piro094823a2007-07-18 00:26:12 +000027%%%
28%%% behavior callbacks
29%%%
Christopher Pirode11d852007-11-18 02:10:20 +000030
Christopher Piro094823a2007-07-18 00:26:12 +000031%%% super() -> SuperModule = atom()
32%%% | none
33
34super() ->
35 tException.
36
37%%% inspect(This) -> string()
38
39inspect(This) ->
Christopher Pirode11d852007-11-18 02:10:20 +000040 "".
Christopher Piro094823a2007-07-18 00:26:12 +000041
42%%%
43%%% class methods
44%%%
45
46new(Type, Message) ->
Christopher Pirode11d852007-11-18 02:10:20 +000047 Super = (super()):new(Type, Message),
48 #?MODULE{super=Super}.
Christopher Piro094823a2007-07-18 00:26:12 +000049
50new() ->
51 new(?tProtocolException_UNKNOWN, undefined).
52new(Type) ->
53 new(Type, undefined).
54
55%%%
56%%% instance methods
57%%%