diff options
author | Raimo Niskanen <[email protected]> | 2014-08-22 12:09:03 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2014-08-22 12:09:03 +0200 |
commit | bdbd6849aa811faf20d5ce7d577a49612266209a (patch) | |
tree | dad16dd76eebe0b8a0d2fe5fbff0f9040ffd7db0 /lib/snmp/src/agent/snmp_target_mib.erl | |
parent | 037590364fe8b5a657563cd7d28a20d84ee8d99f (diff) | |
download | otp-bdbd6849aa811faf20d5ce7d577a49612266209a.tar.gz otp-bdbd6849aa811faf20d5ce7d577a49612266209a.tar.bz2 otp-bdbd6849aa811faf20d5ce7d577a49612266209a.zip |
Clean up config error handling and negative results
Diffstat (limited to 'lib/snmp/src/agent/snmp_target_mib.erl')
-rw-r--r-- | lib/snmp/src/agent/snmp_target_mib.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl index e916f17d6a..df694ed16b 100644 --- a/lib/snmp/src/agent/snmp_target_mib.erl +++ b/lib/snmp/src/agent/snmp_target_mib.erl @@ -182,6 +182,10 @@ check_target_addr( Name, Domain, Address, Timeout, RetryCount, TagList, Params, EngineId, TMask, MMS); check_target_addr( + {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params, + _EngineId, _TMask, _MMS}) -> % Arity 10 + error({bad_address, {Domain, Address}}); +check_target_addr( {Name, Domain, Address, Timeout, RetryCount, TagList, Params, EngineId}) % Arity 8 when is_atom(Domain) -> @@ -197,6 +201,10 @@ check_target_addr( check_target_addr( Name, Domain, Address, Timeout, RetryCount, TagList, Params, EngineId); +check_target_addr( + {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params, + _EngineId}) ->% Arity 8 + error({bad_address, {Domain, Address}}); %% Use dummy engine id if the old style is found check_target_addr( {Name, Domain, Address, Timeout, RetryCount, TagList, Params}) % Arity 7 @@ -210,6 +218,9 @@ check_target_addr( Address = {Ip, Udp}, check_target_addr( Name, Domain, Address, Timeout, RetryCount, TagList, Params); +check_target_addr( + {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params}) -> % Arity 7 + error({bad_address, {Domain, Address}}); %% Use dummy engine id if the old style is found check_target_addr( {Name, Domain, Address, Timeout, RetryCount, TagList, Params, @@ -225,6 +236,10 @@ check_target_addr( Address = {Ip, Udp}, check_target_addr( Name, Domain, Address, Timeout, RetryCount, TagList, Params, TMask, MMS); +check_target_addr( + {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params, + _TMask, _MMS}) -> % Arity 9 + error({bad_address, {Domain, Address}}); check_target_addr(X) -> error({invalid_target_addr, X}). |