|
83 | 83 | | ?CONSUMER_KEY(topic(), partition()). |
84 | 84 |
|
85 | 85 | -type get_producer_error() :: client_down |
86 | | - | {producer_down, noproc} |
| 86 | + | {client_down, any()} |
| 87 | + | {producer_down, any()} |
87 | 88 | | {producer_not_found, topic()} |
88 | | - | { producer_not_found |
89 | | - , topic() |
90 | | - , partition()}. |
| 89 | + | {producer_not_found, topic(), partition()}. |
91 | 90 |
|
92 | 91 | -type get_consumer_error() :: client_down |
93 | | - | {consumer_down, noproc} |
| 92 | + | {client_down, any()} |
| 93 | + | {consumer_down, any()} |
94 | 94 | | {consumer_not_found, topic()} |
95 | 95 | | {consumer_not_found, topic(), partition()}. |
96 | 96 |
|
@@ -829,16 +829,20 @@ ensure_partition_workers(TopicName, State, F) -> |
829 | 829 | end |
830 | 830 | end). |
831 | 831 |
|
832 | | -%% Catch noproc exit exception when making gen_server:call. |
| 832 | +%% Catches exit exceptions when making gen_server:call. |
833 | 833 | -spec safe_gen_call(pid() | atom(), Call, Timeout) -> Return |
834 | 834 | when Call :: term(), |
835 | 835 | Timeout :: infinity | integer(), |
836 | | - Return :: ok | {ok, term()} | {error, client_down | term()}. |
| 836 | + Return :: ok | {ok, term()} | {error, Reason}, |
| 837 | + Reason :: client_down | {client_down, any()} | any(). |
837 | 838 | safe_gen_call(Server, Call, Timeout) -> |
838 | 839 | try |
839 | 840 | gen_server:call(Server, Call, Timeout) |
840 | | - catch exit : {noproc, _} -> |
841 | | - {error, client_down} |
| 841 | + catch |
| 842 | + exit : {noproc, _} -> |
| 843 | + {error, client_down}; |
| 844 | + exit : {Reason, _} -> |
| 845 | + {error, {client_down, Reason}} |
842 | 846 | end. |
843 | 847 |
|
844 | 848 | -spec kf(kpro:field_name(), kpro:struct()) -> kpro:field_value(). |
|
0 commit comments