Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 1 | %%% Copyright (c) 2007- Facebook |
| 2 | %%% Distributed under the Thrift Software License |
Christopher Piro | de11d85 | 2007-11-18 02:10:20 +0000 | [diff] [blame] | 3 | %%% |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 4 | %%% 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 Piro | de11d85 | 2007-11-18 02:10:20 +0000 | [diff] [blame] | 25 | ?DEFINE_ATTR(super). |
| 26 | |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 27 | %%% |
| 28 | %%% behavior callbacks |
| 29 | %%% |
Christopher Piro | de11d85 | 2007-11-18 02:10:20 +0000 | [diff] [blame] | 30 | |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 31 | %%% super() -> SuperModule = atom() |
| 32 | %%% | none |
| 33 | |
| 34 | super() -> |
| 35 | tException. |
| 36 | |
| 37 | %%% inspect(This) -> string() |
| 38 | |
| 39 | inspect(This) -> |
Christopher Piro | de11d85 | 2007-11-18 02:10:20 +0000 | [diff] [blame] | 40 | "". |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 41 | |
| 42 | %%% |
| 43 | %%% class methods |
| 44 | %%% |
| 45 | |
| 46 | new(Type, Message) -> |
Christopher Piro | de11d85 | 2007-11-18 02:10:20 +0000 | [diff] [blame] | 47 | Super = (super()):new(Type, Message), |
| 48 | #?MODULE{super=Super}. |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 49 | |
| 50 | new() -> |
| 51 | new(?tProtocolException_UNKNOWN, undefined). |
| 52 | new(Type) -> |
| 53 | new(Type, undefined). |
| 54 | |
| 55 | %%% |
| 56 | %%% instance methods |
| 57 | %%% |