summaryrefslogtreecommitdiff
path: root/lib/kernel
diff options
context:
space:
mode:
authorRaimo Niskanen <raimo@erlang.org>2023-02-23 12:58:25 +0100
committerRaimo Niskanen <raimo@erlang.org>2023-02-23 12:59:43 +0100
commitb0afc29474f9625aa0b466b6672e0bbcefd07535 (patch)
tree5ef8a33e407c6d048e1658a8213534c56febe736 /lib/kernel
parentb31b8ad1225caed2944f6f1eb4a9d98fc7af9709 (diff)
parent381648e4c054405083967a2ada779fd5f8adf37d (diff)
downloaderlang-b0afc29474f9625aa0b466b6672e0bbcefd07535.tar.gz
Merge branch 'raimo/gen-sync-start-fail/GH-6339' OTP-18471
* raimo/gen-sync-start-fail/GH-6339: Update documentation after review Fix bug - start_link should not return an unwrapped error Reason Change to a more coherent behaviour for init_fail and exit in init Clarify documentation Update doc with proc_lib:init_fail/2,3 Simplify error propagation Implement synchronous init failure for gen processes Test looping over gen_server init failure
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/src/logger_olp.erl10
-rw-r--r--lib/kernel/test/logger_SUITE.erl4
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/kernel/src/logger_olp.erl b/lib/kernel/src/logger_olp.erl
index 1379f8cf54..6bbf9963b6 100644
--- a/lib/kernel/src/logger_olp.erl
+++ b/lib/kernel/src/logger_olp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2017-2022. All Rights Reserved.
+%% Copyright Ericsson AB 2017-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -193,13 +193,11 @@ init([Name,Module,Args,Options]) ->
gen_server:enter_loop(?MODULE, [], State);
Error ->
unregister(Name),
- proc_lib:init_ack(Error),
- ignore %% Just to shut Dialyzer up - ignored
+ proc_lib:init_fail(Error, {exit,normal})
catch
- _:Error ->
+ _:Reason ->
unregister(Name),
- proc_lib:init_ack(Error),
- ignore %% Just to shut Dialyzer up - ignored
+ proc_lib:init_fail({error,Reason}, {exit,normal})
end.
%% This is the synchronous load event.
diff --git a/lib/kernel/test/logger_SUITE.erl b/lib/kernel/test/logger_SUITE.erl
index ef1bef9df3..3041fb0755 100644
--- a/lib/kernel/test/logger_SUITE.erl
+++ b/lib/kernel/test/logger_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2018-2022. All Rights Reserved.
+%% Copyright Ericsson AB 2018-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1517,5 +1517,5 @@ check_config(_) ->
%% this function is also a test. When logger.hrl used non-qualified
%% apply/3 call, any module that was implementing apply/3 could
%% not use any logging macro
-apply(_Any, _Any, _Any) ->
+apply(_, _, _) ->
ok.