Esempio n. 1
0
        internal static JsonSerializationException Create(IJsonLineInfo?lineInfo, string path, string message, Exception?ex)
        {
            message = JsonPosition.FormatMessage(lineInfo, path, message);

            int lineNumber;
            int linePosition;

            if (lineInfo != null && lineInfo.HasLineInfo())
            {
                lineNumber   = lineInfo.LineNumber;
                linePosition = lineInfo.LinePosition;
            }
            else
            {
                lineNumber   = 0;
                linePosition = 0;
            }

            return(new JsonSerializationException(message, path, lineNumber, linePosition, ex));
        }
Esempio n. 2
0
        internal static JsonException Create(IJsonLineInfo lineInfo, string path, string message)
        {
            message = JsonPosition.FormatMessage(lineInfo, path, message);

            return(new JsonException(message));
        }
        internal static JsonWriterException Create(string path, string message, Exception?ex)
        {
            message = JsonPosition.FormatMessage(null, path, message);

            return(new JsonWriterException(message, path, ex));
        }