Exception: Purl::RegistryError

Inherits:
Error
  • Object
show all
Defined in:
lib/purl/errors.rb

Overview

Registry URL generation errors

Contains additional context about which type caused the error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, type: nil) ⇒ RegistryError

Returns a new instance of RegistryError.

Parameters:

  • message (String)

    error message

  • type (String, nil) (defaults to: nil)

    PURL type that caused the error



81
82
83
84
# File 'lib/purl/errors.rb', line 81

def initialize(message, type: nil)
  super(message)
  @type = type
end

Instance Attribute Details

#typeString? (readonly)

Returns the PURL type that caused the error.

Returns:

  • (String, nil)

    the PURL type that caused the error



77
78
79
# File 'lib/purl/errors.rb', line 77

def type
  @type
end