diff options
author | Micael Karlberg <[email protected]> | 2018-09-07 18:31:16 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-17 14:41:23 +0200 |
commit | 229795aba1d4da773938715f2e5122d4885af826 (patch) | |
tree | 2b1b18af6c5ae980111e66144e4a3873331e365e /lib/snmp/src/misc/snmp_log.erl | |
parent | b665dd1fdab1c03b123911b5ccaca4dd0fc2809c (diff) | |
download | otp-229795aba1d4da773938715f2e5122d4885af826.tar.gz otp-229795aba1d4da773938715f2e5122d4885af826.tar.bz2 otp-229795aba1d4da773938715f2e5122d4885af826.zip |
[snmp] Add proper version
Also fixed case clause.
OTP-15287 (ERIERL-206)
Diffstat (limited to 'lib/snmp/src/misc/snmp_log.erl')
-rw-r--r-- | lib/snmp/src/misc/snmp_log.erl | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/snmp/src/misc/snmp_log.erl b/lib/snmp/src/misc/snmp_log.erl index ce93b95c8e..5713c14912 100644 --- a/lib/snmp/src/misc/snmp_log.erl +++ b/lib/snmp/src/misc/snmp_log.erl @@ -652,8 +652,8 @@ do_log_to_file(Log, TextFile, Mibs, Start, Stop) -> {Tag, S} when (Tag =:= ok) orelse (Tag =:= error) -> io:format(Fd, "~s", [S]), Tag; - X -> - X + Ignore -> + Ignore end end, Res = (catch loop(Log, Write)), @@ -696,8 +696,8 @@ loop({Cont, Terms}, Log, Write, NumOK, NumERR) -> loop(disk_log:chunk(Log, Cont), Log, Write, NumOK+AddedOK, NumERR+AddedERR) catch - T:E -> - {error, {T, E}} + C:E:S -> + {error, {C, E, S}} end; loop({Cont, Terms, BadBytes}, Log, Write, NumOK, NumERR) -> error_logger:error_msg("Skipping ~w bytes while converting ~p~n~n", @@ -707,8 +707,8 @@ loop({Cont, Terms, BadBytes}, Log, Write, NumOK, NumERR) -> loop(disk_log:chunk(Log, Cont), Log, Write, NumOK+AddedOK, NumERR+AddedERR) catch - T:E -> - {error, {T, E}} + C:E:S -> + {error, {C, E, S}} end. @@ -718,16 +718,13 @@ loop_terms(Terms, Write) -> loop_terms([], _Write, NumOK, NumERR) -> {ok, {NumOK, NumERR}}; loop_terms([Term|Terms], Write, NumOK, NumERR) -> - try Write(Term) of + case Write(Term) of ok -> loop_terms(Terms, Write, NumOK+1, NumERR); error -> loop_terms(Terms, Write, NumOK, NumERR+1); _ -> loop_terms(Terms, Write, NumOK, NumERR) - catch - T:E:S -> - {error, {T, E, S}} end. |