Exception: Quonfig::Errors::InvalidEnvironmentError

Inherits:
Quonfig::Error
  • Object
show all
Defined in:
lib/quonfig/errors/invalid_environment_error.rb

Overview

Raised when the requested environment (via ‘environment:` option or QUONFIG_ENVIRONMENT) isn’t listed in the workspace’s ‘quonfig.json`. Catches typos like `“prdoduction”` early instead of silently evaluating against default rules.

Instance Method Summary collapse

Constructor Details

#initialize(environment, available = nil) ⇒ InvalidEnvironmentError

Returns a new instance of InvalidEnvironmentError.



10
11
12
13
14
15
16
# File 'lib/quonfig/errors/invalid_environment_error.rb', line 10

def initialize(environment, available = nil)
  message = "[quonfig] Environment \"#{environment}\" not found in workspace"
  if available && !Array(available).empty?
    message += "; available environments: #{Array(available).join(', ')}"
  end
  super(message)
end