Configurable message creation

Allow changing the strategy to format of the error message.