-
Notifications
You must be signed in to change notification settings - Fork 251
/
Copy patherror.rb
74 lines (66 loc) · 2.28 KB
/
error.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
class Net::LDAP
class LdapError < StandardError
def message
"Deprecation warning: Net::LDAP::LdapError is no longer used. Use Net::LDAP::Error or rescue one of it's subclasses. \n" + super
end
end
class Error < StandardError; end
class AlreadyOpenedError < Error; end
class SocketError < Error; end
class ConnectionRefusedError < Error;
def initialize(*args)
warn_deprecation_message
super
end
def message
warn_deprecation_message
super
end
private
def warn_deprecation_message
warn "Deprecation warning: Net::LDAP::ConnectionRefused will be deprecated. Use Errno::ECONNREFUSED instead."
end
end
class ConnectionError < Error
def self.new(errors)
error = errors.first.first
if errors.size == 1
if error.kind_of? Errno::ECONNREFUSED
return Net::LDAP::ConnectionRefusedError.new(error.message)
end
return Net::LDAP::Error.new(error.message)
end
super
end
def initialize(errors)
message = "Unable to connect to any given server: \n #{errors.map { |e, h, p| "#{e.class}: #{e.message} (#{h}:#{p})" }.join("\n ")}"
super(message)
end
end
class NoOpenSSLError < Error; end
class NoStartTLSResultError < Error; end
class NoSearchBaseError < Error; end
class StartTLSError < Error; end
class EncryptionUnsupportedError < Error; end
class EncMethodUnsupportedError < Error; end
class AuthMethodUnsupportedError < Error; end
class BindingInformationInvalidError < Error; end
class NoBindResultError < Error; end
class SASLChallengeOverflowError < Error; end
class SearchSizeInvalidError < Error; end
class SearchScopeInvalidError < Error; end
class ResponseTypeInvalidError < Error; end
class ResponseMissingOrInvalidError < Error; end
class EmptyDNError < Error; end
class HashTypeUnsupportedError < Error; end
class OperatorError < Error; end
class SubstringFilterError < Error; end
class SearchFilterError < Error; end
class BERInvalidError < Error; end
class SearchFilterTypeUnknownError < Error; end
class BadAttributeError < Error; end
class FilterTypeUnknownError < Error; end
class FilterSyntaxInvalidError < Error; end
class EntryOverflowError < Error; end
class ProtocolNotSupported < Error; end
end