Error message for wrong type metafield can be confusing at time

Found in

EPiServer.Commerce 10.4.0

Fixed in

EPiServer.Commerce 10.7.1

Created

May 22 2017

Updated

Jun 02 2017

Area

Core

State

Closed, Fixed and tested


Description

When a value set to a metafield which does not match the type of the metafield itself, there will be this error message:

System.ArgumentException: value is a System.Double but should be a System.Int32
Parameter name: value
at Mediachase.MetaDataPlus.Configurator.MetaDataTypes.GetDatabaseValueInteger(Object value)

This is confusing and is not helpful to resolve the problem. Suggested error message is:

"Value of is 4.5, of type double, but should be an int"