private void BuildMessages()
        {
            if (_formattable is FormattableString formattableString)
            {
                string   format = formattableString.Format;
                object[] args   = formattableString.GetArguments();

                StringBuilder sb = new StringBuilder(format.Length + (args.Length * 8));
                if (args.Length > 0)
                {
                    sb.AppendFormat(CultureInfo.InvariantCulture, format, args);
                }
                else
                {
                    sb.Append(format);
                }

                _message         = sb.ToString();
                _extendedMessage = JSchemaException.FormatMessage(this, Path, sb);
            }
            else
            {
                string message = _formattable.ToString(null, CultureInfo.InvariantCulture);

                _message         = message;
                _extendedMessage = JSchemaException.FormatMessage(this, Path, message);
            }

            _formattable = null;
        }
 internal string BuildExtendedMessage()
 {
     return(JSchemaException.FormatMessage(this, Path, Message));
 }
        internal static JSchemaException Create(string message, ValidationError validationError)
        {
            JSchemaException ex = new JSchemaException(validationError.BuildExtendedMessage(), null, validationError);

            return(ex);
        }