Example #1
0
        private void raiseTypeError(string message, object source, bool warning = false)
        {
            var exc          = new StructuralTypeException("Type checking the data: " + message);
            var notification = warning ?
                               ExceptionNotification.Warning(exc) :
                               ExceptionNotification.Error(exc);

            ExceptionHandler.NotifyOrThrow(source, notification);
        }
        private void raiseTypeError(string message, object source, bool warning = false, string location = null)
        {
            var exMessage = $"Type checking the data: {message}";

            if (!string.IsNullOrEmpty(location))
            {
                exMessage += $" (at {location})";
            }

            var exc          = new StructuralTypeException(exMessage);
            var notification = warning ?
                               ExceptionNotification.Warning(exc) :
                               ExceptionNotification.Error(exc);

            ExceptionHandler.NotifyOrThrow(source, notification);
        }