Exception: Safire::Errors::CertificateError
- Defined in:
- lib/safire/errors.rb
Overview
Raised for X.509 certificate errors (e.g., in UDAP flows).
Instance Attribute Summary collapse
-
#reason ⇒ String?
readonly
Why the certificate is invalid (e.g. +“expired”+, +“untrusted”+).
-
#subject ⇒ String?
readonly
Certificate subject string (safe to log).
Instance Method Summary collapse
-
#initialize(reason: nil, subject: nil) ⇒ CertificateError
constructor
A new instance of CertificateError.
Constructor Details
#initialize(reason: nil, subject: nil) ⇒ CertificateError
Returns a new instance of CertificateError.
181 182 183 184 185 |
# File 'lib/safire/errors.rb', line 181 def initialize(reason: nil, subject: nil) @reason = reason @subject = subject super() end |
Instance Attribute Details
#reason ⇒ String? (readonly)
Returns why the certificate is invalid (e.g. +“expired”+, +“untrusted”+).
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/safire/errors.rb', line 178 class CertificateError < Error attr_reader :reason, :subject def initialize(reason: nil, subject: nil) @reason = reason @subject = subject super() end private def parts = ['Certificate error'] parts << @reason if @reason parts << "(subject: #{@subject})" if @subject parts.join(' — ') end end |
#subject ⇒ String? (readonly)
Returns certificate subject string (safe to log).
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/safire/errors.rb', line 178 class CertificateError < Error attr_reader :reason, :subject def initialize(reason: nil, subject: nil) @reason = reason @subject = subject super() end private def parts = ['Certificate error'] parts << @reason if @reason parts << "(subject: #{@subject})" if @subject parts.join(' — ') end end |