Exception: Coradoc::UnsupportedFormatError

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

Overview

Error raised when a requested format is not supported

Examples:

raise UnsupportedFormatError.new(:docx, available: [:html, :markdown])

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format, available: []) ⇒ UnsupportedFormatError

Create a new unsupported format error

Parameters:

  • format (Symbol, String)

    The requested format

  • available (Array<Symbol>) (defaults to: [])

    List of available formats



298
299
300
301
302
# File 'lib/coradoc/errors.rb', line 298

def initialize(format, available: [])
  @requested_format = format
  @available_formats = available
  super(build_message)
end

Instance Attribute Details

#available_formatsObject (readonly)

Returns the value of attribute available_formats.



292
293
294
# File 'lib/coradoc/errors.rb', line 292

def available_formats
  @available_formats
end

#requested_formatObject (readonly)

Returns the value of attribute requested_format.



292
293
294
# File 'lib/coradoc/errors.rb', line 292

def requested_format
  @requested_format
end