aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_peer_fsm.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2012-08-28 15:05:22 +0200
committerAnders Svensson <[email protected]>2012-08-28 15:05:22 +0200
commit88c13abb6e803c2be0288ce0c46f080e951fc8b0 (patch)
tree1893986d7be49b8727dfe458ead44938db8592ef /lib/diameter/src/base/diameter_peer_fsm.erl
parentbc2b1d56047bd370dd6e1e5b5377601bfcd89d23 (diff)
parent1c3884894917a7e84d95f7c82c61c6205d802717 (diff)
downloadotp-88c13abb6e803c2be0288ce0c46f080e951fc8b0.tar.gz
otp-88c13abb6e803c2be0288ce0c46f080e951fc8b0.tar.bz2
otp-88c13abb6e803c2be0288ce0c46f080e951fc8b0.zip
Merge branch 'anders/diameter/capabilities_encode/OTP-10203' into maint
* anders/diameter/capabilities_encode/OTP-10203: Deal with the fact that capabilities config may be incomplete
Diffstat (limited to 'lib/diameter/src/base/diameter_peer_fsm.erl')
-rw-r--r--lib/diameter/src/base/diameter_peer_fsm.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl
index bbda62c32b..ca2e8c56cb 100644
--- a/lib/diameter/src/base/diameter_peer_fsm.erl
+++ b/lib/diameter/src/base/diameter_peer_fsm.erl
@@ -250,14 +250,27 @@ handle_info(T, #state{} = State) ->
?LOG(stop, T),
x(T, State)
catch
+ exit: {diameter_codec, encode, _} = Reason ->
+ close_wd(Reason, State#state.parent),
+ ?LOG(stop, Reason),
+ %% diameter_codec:encode/2 emits an error report. Only
+ %% indicate the probable reason here.
+ diameter_lib:info_report(probable_configuration_error,
+ insufficient_capabilities),
+ {stop, {shutdown, Reason}, State};
{?MODULE, Tag, Reason} ->
?LOG(Tag, {Reason, T}),
{stop, {shutdown, Reason}, State}
end.
-%% The form of the exception caught here is historical. It's
+%% The form of the throw caught here is historical. It's
%% significant that it's not a 2-tuple, as in ?FAILURE(Reason),
%% since these are caught elsewhere.
+%% Note that there's no guarantee that the service and transport
+%% capabilities are good enough to build a CER/CEA that can be
+%% succesfully encoded. It's not checked at diameter:add_transport/2
+%% since this can be called before creating the service.
+
x(Reason, #state{} = S) ->
close_wd(Reason, S),
{stop, {shutdown, Reason}, S}.