Project

General

Profile

Actions

Bug #14476

closed

Caster fails with incorrect exception trying to cast invalid real from string

Added by Tomer Brisker about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Parameters
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

attempting to cast a string that isn't a valid real number leads to the exception:

Error while parsing smartvar
 | NoMethodError: undefined method `cast_value_integer' for #<Foreman::Parameters::Caster:0x000000107a4da0>
 | /home/tbrisker/foreman/app/services/foreman/parameters/caster.rb:84:in `cast_real'
 | /home/tbrisker/foreman/app/services/foreman/parameters/caster.rb:33:in `casted_value'
 | /home/tbrisker/foreman/app/services/foreman/parameters/caster.rb:17:in `cast!'
 | /home/tbrisker/foreman/app/models/lookup_value.rb:71:in `validate_and_cast_value'
... snipped rest of stacktrace


Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #10232: move validations and casting out of lookup keys and values into single-responsibility classesClosedTom Caspy04/22/2015Actions
Actions

Also available in: Atom PDF