Current section

113 Versions

Jump to

Compare versions

4 files changed
+28 additions
-19 deletions
  @@ -24,4 +24,4 @@
24 24 [{<<"app">>,<<"kafka_protocol">>},
25 25 {<<"optional">>,false},
26 26 {<<"requirement">>,<<"4.3.4">>}]}]}.
27 - {<<"version">>,<<"4.5.6">>}.
27 + {<<"version">>,<<"4.5.7">>}.
  @@ -9,7 +9,7 @@
9 9 {test, [
10 10 {deps, [ {hut, "1.3.0"}
11 11 , {jsone, "1.7.0"}
12 - , {meck, "0.9.2"}
12 + , {meck, "1.2.0"}
13 13 , {proper, "1.5.0"}
14 14 , {snappyer, "1.2.9"}
15 15 , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {branch, "1.0.10"}}}
  @@ -1,6 +1,6 @@
1 1 {application,brod,
2 2 [{description,"Apache Kafka Erlang client library"},
3 - {vsn,"4.5.6"},
3 + {vsn,"4.5.7"},
4 4 {registered,[]},
5 5 {applications,[kernel,stdlib,kafka_protocol]},
6 6 {env,[]},
  @@ -408,7 +408,7 @@ start_children([], NChildren, _SupName) ->
408 408
409 409 do_start_child(SupName, Child) ->
410 410 #child{mfargs = {M, F, Args}} = Child,
411 - case catch apply(M, F, Args) of
411 + try apply(M, F, Args) of
412 412 {ok, Pid} when is_pid(Pid) ->
413 413 NChild = Child#child{pid = Pid},
414 414 report_progress(NChild, SupName),
  @@ -419,12 +419,13 @@ do_start_child(SupName, Child) ->
419 419 {ok, Pid, Extra};
420 420 ignore ->
421 421 {ok, undefined};
422 - {error, What} -> {error, What};
423 - What -> {error, What}
422 + {error, What} -> {error, What}
423 + catch
424 + C:What -> {error, {C, What}}
424 425 end.
425 426
426 427 do_start_child_i(M, F, A) ->
427 - case catch apply(M, F, A) of
428 + try apply(M, F, A) of
428 429 {ok, Pid} when is_pid(Pid) ->
429 430 {ok, Pid};
430 431 {ok, Pid, Extra} when is_pid(Pid) ->
  @@ -432,9 +433,10 @@ do_start_child_i(M, F, A) ->
432 433 ignore ->
433 434 {ok, undefined};
434 435 {error, Error} ->
435 - {error, Error};
436 - What ->
437 - {error, What}
436 + {error, Error}
437 + catch
438 + C:What ->
439 + {error, {C, What}}
438 440 end.
439 441
440 442 %%% ---------------------------------------------------
  @@ -754,15 +756,16 @@ terminate(_Reason, State) ->
754 756 code_change(_, State, _) ->
755 757 case (State#state.module):init(State#state.args) of
756 758 {ok, {SupFlags, StartSpec}} ->
757 - case catch check_flags(SupFlags) of
759 + try check_flags(SupFlags) of
758 760 ok ->
759 761 {Strategy, MaxIntensity, Period} = SupFlags,
760 762 update_childspec(State#state{strategy = Strategy,
761 763 intensity = MaxIntensity,
762 764 period = Period},
763 - StartSpec);
764 - Error ->
765 - {error, Error}
765 + StartSpec)
766 + catch
767 + C:Error ->
768 + {error, {C, Error}}
766 769 end;
767 770 ignore ->
768 771 {ok, State};
  @@ -1419,13 +1422,14 @@ remove_child(Child, State) ->
1419 1422 %% Returns: {ok, state()} | Error
1420 1423 %%-----------------------------------------------------------------
1421 1424 do_init(SupName, Type, StartSpec, Mod, Args) ->
1422 - case catch init_state(SupName, Type, Mod, Args) of
1425 + try init_state(SupName, Type, Mod, Args) of
1423 1426 {ok, State} when ?is_simple(State) ->
1424 1427 init_dynamic(State, StartSpec);
1425 1428 {ok, State} ->
1426 - init_children(State, StartSpec);
1427 - Error ->
1428 - {stop, {supervisor_data, Error}}
1429 + init_children(State, StartSpec)
1430 + catch
1431 + C:Error ->
1432 + {stop, {supervisor_data, {C, Error}}}
1429 1433 end.
1430 1434
1431 1435 init_state(SupName, {Strategy, MaxIntensity, Period}, Mod, Args) ->
  @@ -1489,7 +1493,12 @@ check_startspec([], Res) ->
1489 1493 {ok, lists:reverse(Res)}.
1490 1494
1491 1495 check_childspec({Name, Func, RestartType, Shutdown, ChildType, Mods}) ->
1492 - catch check_childspec(Name, Func, RestartType, Shutdown, ChildType, Mods);
1496 + try
1497 + check_childspec(Name, Func, RestartType, Shutdown, ChildType, Mods)
1498 + catch
1499 + C:Reason ->
1500 + {C, Reason}
1501 + end;
1493 1502 check_childspec(X) -> {invalid_child_spec, X}.
1494 1503
1495 1504 check_childspec(Name, Func, RestartType, Shutdown, ChildType, Mods) ->