aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_trap.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-01-20 11:14:06 +0100
committerMicael Karlberg <[email protected]>2012-01-20 11:14:06 +0100
commitef4af949a1f946c965997957e10cb638e7d01c22 (patch)
tree60dd18f1c5709dd0c219d2adfd97b626dc25ca3a /lib/snmp/src/agent/snmpa_trap.erl
parent65db6eb562b0376dd29fc60e9378d7b3b8ac386b (diff)
parenta1c84a9eb253f8b7aa5cdc8b88ca17691ed52c14 (diff)
downloadotp-ef4af949a1f946c965997957e10cb638e7d01c22.tar.gz
otp-ef4af949a1f946c965997957e10cb638e7d01c22.tar.bz2
otp-ef4af949a1f946c965997957e10cb638e7d01c22.zip
Merge branch 'bmk/snmp/agent/get_bulk_with_large_max_reps/OTP-9700' into bmk/snmp/snmp4173_integration/r13
Diffstat (limited to 'lib/snmp/src/agent/snmpa_trap.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_trap.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/snmp/src/agent/snmpa_trap.erl b/lib/snmp/src/agent/snmpa_trap.erl
index 450cb2e9f4..3b31c8d909 100644
--- a/lib/snmp/src/agent/snmpa_trap.erl
+++ b/lib/snmp/src/agent/snmpa_trap.erl
@@ -339,9 +339,25 @@ send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs, NetIf) ->
send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs,
LocalEngineID, NetIf).
+%% The agent normally does not care about the result,
+%% but since it can be usefull when debugging, add
+%% some info when we fail to send the trap(s).
send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs, LocalEngineID, NetIf) ->
- (catch do_send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs,
- LocalEngineID, NetIf)).
+ try
+ begin
+ do_send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs,
+ LocalEngineID, NetIf)
+ end
+ catch
+ T:E ->
+ Info = [{args, [TrapRec, NotifyName, ContextName,
+ Recv, Vbs, LocalEngineID, NetIf]},
+ {tag, T},
+ {err, E},
+ {stacktrace, erlang:get_stacktrace()}],
+ {error, {failed_sending_trap, Info}}
+ end.
+
do_send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs,
LocalEngineID, NetIf) ->