diff options
author | Tony Garnock-Jones <tonyg@lshift.net> | 2009-05-27 14:32:17 +0100 |
---|---|---|
committer | Tony Garnock-Jones <tonyg@lshift.net> | 2009-05-27 14:32:17 +0100 |
commit | b8fcc6c9cee25635a25c3f44dd3f1a1baa758449 (patch) | |
tree | a17f8993ae059c09624309f16e960aafaf96adb5 /src/rabbit_misc.erl | |
parent | e75a9bce465ae68efd8b90d042c605b4b90cc8d9 (diff) | |
parent | 77b82d6213b973473085aa5224abb9b06c2a7936 (diff) | |
download | rabbitmq-server-b8fcc6c9cee25635a25c3f44dd3f1a1baa758449.tar.gz |
merge default into bug20654
Diffstat (limited to 'src/rabbit_misc.erl')
-rw-r--r-- | src/rabbit_misc.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index af044607..72e16f0f 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -36,6 +36,7 @@ -export([method_record_type/1, polite_pause/0, polite_pause/1]). -export([die/1, frame_error/2, protocol_error/3, protocol_error/4]). +-export([not_found/1]). -export([get_config/1, get_config/2, set_config/2]). -export([dirty_read/1]). -export([r/3, r/2, r_arg/4, rs/1]). @@ -72,6 +73,7 @@ (atom() | amqp_error(), string(), [any()]) -> no_return()). -spec(protocol_error/4 :: (atom() | amqp_error(), string(), [any()], atom()) -> no_return()). +-spec(not_found/1 :: (r(atom())) -> no_return()). -spec(get_config/1 :: (atom()) -> {'ok', any()} | not_found()). -spec(get_config/2 :: (atom(), A) -> A). -spec(set_config/2 :: (atom(), any()) -> 'ok'). @@ -141,6 +143,8 @@ protocol_error(Error, Explanation, Params, Method) -> CompleteExplanation = lists:flatten(io_lib:format(Explanation, Params)), exit({amqp, Error, CompleteExplanation, Method}). +not_found(R) -> protocol_error(not_found, "no ~s", [rs(R)]). + get_config(Key) -> case dirty_read({rabbit_config, Key}) of {ok, {rabbit_config, Key, V}} -> {ok, V}; |