|
37 | 37 |
|
38 | 38 | -export([method_record_type/1, polite_pause/0, polite_pause/1]). |
39 | 39 | -export([die/1, frame_error/2, amqp_error/4, |
40 | | - protocol_error/3, protocol_error/4]). |
| 40 | + protocol_error/3, protocol_error/4, protocol_error/1]). |
41 | 41 | -export([not_found/1]). |
42 | 42 | -export([get_config/1, get_config/2, set_config/2]). |
43 | 43 | -export([dirty_read/1]). |
|
95 | 95 | (rabbit_framing:amqp_exception(), string(), [any()], |
96 | 96 | rabbit_framing:amqp_method_name()) |
97 | 97 | -> no_return()). |
| 98 | +-spec(protocol_error/1 :: (rabbit_types:amqp_error()) -> no_return()). |
98 | 99 | -spec(not_found/1 :: (rabbit_types:r(atom())) -> no_return()). |
99 | 100 | -spec(get_config/1 :: |
100 | 101 | (atom()) -> rabbit_types:ok_or_error2(any(), 'not_found')). |
@@ -199,7 +200,10 @@ protocol_error(Name, ExplanationFormat, Params) -> |
199 | 200 | protocol_error(Name, ExplanationFormat, Params, none). |
200 | 201 |
|
201 | 202 | protocol_error(Name, ExplanationFormat, Params, Method) -> |
202 | | - exit(amqp_error(Name, ExplanationFormat, Params, Method)). |
| 203 | + protocol_error(amqp_error(Name, ExplanationFormat, Params, Method)). |
| 204 | + |
| 205 | +protocol_error(#amqp_error{} = Error) -> |
| 206 | + exit(Error). |
203 | 207 |
|
204 | 208 | not_found(R) -> protocol_error(not_found, "no ~s", [rs(R)]). |
205 | 209 |
|
|
0 commit comments