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.
232 233 234 235 236 |
# File 'lib/safire/errors.rb', line 232 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”).
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/safire/errors.rb', line 229 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).
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/safire/errors.rb', line 229 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 |