Provides data for the Error event.
Inheritance: System.EventArgs
Example #1
0
        public static void HandleDeserializationError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs errorArgs)
        {
            var currentError = errorArgs.ErrorContext.Error.Message;

            UnityEngine.Debug.LogError("CloudLoader.HandleDeserializationError -" + currentError);
            errorArgs.ErrorContext.Handled = true;
        }
Example #2
0
 private static void DeserializeErrorHandler(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs e)
 {
     if (e.ErrorContext.Error.Message.Contains("Aurora.Devices.SteelSeriesHID.SteelSeriesHIDDevice") && e.CurrentObject is HashSet <Type> dd)
     {
         dd.Add(typeof(Aurora.Devices.UnifiedHID.UnifiedHIDDevice));
         e.ErrorContext.Handled = true;
     }
 }
Example #3
0
        private static void HandleDeserializationError(object sender,
                                                       Newtonsoft.Json.Serialization.ErrorEventArgs e)
        {
            var currentError = e.ErrorContext.Error.Message;

            Main.DebugLog(currentError);
            e.ErrorContext.Handled = true;
        }
        internal void OnError(Newtonsoft.Json.Serialization.ErrorEventArgs e)
        {
            EventHandler <Newtonsoft.Json.Serialization.ErrorEventArgs> eventHandler = this.Error;

            if (eventHandler != null)
            {
                eventHandler(this, e);
            }
        }
        internal void OnError(ErrorEventArgs e)
        {
            EventHandler <ErrorEventArgs> error = Error;

            if (error != null)
            {
                error(this, e);
            }
        }
Example #6
0
        internal void method_3(Newtonsoft.Json.Serialization.ErrorEventArgs errorEventArgs_0)
        {
            EventHandler <Newtonsoft.Json.Serialization.ErrorEventArgs> handler = this.eventHandler_0;

            if (handler != null)
            {
                handler(this, errorEventArgs_0);
            }
        }
Example #7
0
        internal void OnError(Newtonsoft.Json.Serialization.ErrorEventArgs e)
        {
            EventHandler <Newtonsoft.Json.Serialization.ErrorEventArgs> eventHandler = this.Error;

            if (eventHandler == null)
            {
                return;
            }
            eventHandler((object)this, e);
        }
Example #8
0
    private static void ErrorHandler(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs args)
    {
        string error = args.ErrorContext.Error.Message;

        error = error.Replace("Could not find member", "Editor doesn't expect");

        sb.AppendLine(error);
        errorCounter++;
        args.ErrorContext.Handled = true;
    }
Example #9
0
        private void LoadProfilesError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs e)
        {
            if (e.CurrentObject.GetType().Equals(typeof(ObservableCollection <Layer>)))
            {
                e.ErrorContext.Handled = true;
            }

            if (e.CurrentObject.GetType() == typeof(Layer) && e.ErrorContext.Member.Equals("Handler"))
            {
                ((Layer)e.ErrorContext.OriginalObject).Handler = null;
                e.ErrorContext.Handled = true;
            }
        }
Example #10
0
        protected virtual void LoadProfilesError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs e)
        {
            if (e.CurrentObject != null)
            {
                if (e.CurrentObject.GetType().Equals(typeof(ObservableCollection <Layer>)))
                {
                    e.ErrorContext.Handled = true;
                }

                if (e.CurrentObject.GetType() == typeof(Layer) && e.ErrorContext.Member.Equals("Handler"))
                {
                    ((Layer)e.ErrorContext.OriginalObject).Handler = null;
                    e.ErrorContext.Handled = true;
                }
            }
            else if (e.ErrorContext.Path.Equals("$type") && e.ErrorContext.Member == null && e.ErrorContext.Error.Message.Contains("WrapperProfile"))
            {
                MessageBox.Show($"The profile type for {this.Config.Name} has been changed, your profile will be reset and your old one moved to have the extension '.corrupted', ignore the following error", "Profile type changed", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #11
0
 private static void ErrorHandler(object?_, Newtonsoft.Json.Serialization.ErrorEventArgs e, string filename)
 {
     throw new InvalidDataException("This file \"" + filename + "\" does not match the format for JSON. Check if it isn't corrupted by opening it in Notepad or another text editor.", e.ErrorContext.Error);
 }
Example #12
0
 private static void HandleError(object sender, ErrorEventArgs e)
 {
     if (FullInspectorSettings.EmitWarnings)
     {
         Debug.LogWarning(JsonNetSerializer.FormatError(e.ErrorContext));
     }
     e.ErrorContext.Handled = true;
 }
Example #13
0
 internal void OnError(ErrorEventArgs e)
 {
     Error?.Invoke(this, e);
 }
Example #14
0
 private void OnJsonError(object sender, ErrorEventArgs errorEventArgs)
 {
     _logger.LogError(errorEventArgs?.ErrorContext?.Error?.Message);
     _logger.LogError($"JSON Parse Error at '{errorEventArgs?.ErrorContext?.Path}'");
 }
 internal void OnError(ErrorEventArgs e)
 {
     EventHandler<ErrorEventArgs> error = Error;
       if (error != null)
     error(this, e);
 }
Example #16
0
 /// <summary>
 /// Called when a JSON error occurs.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="ErrorEventArgs"/> instance containing the event data.</param>
 /// <remarks>Prevents exceptions bubbling up to the consumer.</remarks>
 private static void OnError(object sender, ErrorEventArgs e)
 {
     e.ErrorContext.Handled = true;
 }
Example #17
0
 private static void deserialiseErrorEventHandler(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs e)
 {
 }
Example #18
0
 private static void HandleSerializationError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs e)
 {
     //            var currentError = e.ErrorContext.Error.Message;
     e.ErrorContext.Handled = false;
 }
 void DeserializerOnError(object sender, ErrorEventArgs errorEventArgs)
 {
     errorStrategy.HandleErrorOnDeserialize(sender, errorEventArgs);
 }
Example #20
0
 static void IgnoreError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs args)
 {
 }
 public void HandleError(object source, Newtonsoft.Json.Serialization.ErrorEventArgs args)
 {
     args.ErrorContext.Handled = true;
 }
Example #22
0
        public void HandleDeserializationError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs errorArgs)
        {
            var currentError = errorArgs.ErrorContext.Error.Message;

            errorArgs.ErrorContext.Handled = true;
        }
Example #23
0
 private static void HandleDeserializationError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs errorArgs)
 {
     Debug.LogWarning($"Json deserialization error: {errorArgs.ErrorContext.Error.Message}");
     errorArgs.ErrorContext.Handled = true;
 }
Example #24
0
 /// <summary>
 /// Json.NET callback for when an error occurs. We simply print out the error and continue
 /// with the deserialization process.
 /// </summary>
 private static void HandleError(object sender, ErrorEventArgs e) {
     if (fiSettings.EmitWarnings) {
         Debug.LogWarning(FormatError(e.ErrorContext));
     }
     e.ErrorContext.Handled = true;
 }
Example #25
0
 private static void OnError(object sender, ErrorEventArgs e) {
     //MainLog.Logger.Warn($"Error during JSON serialization for {e.CurrentObject}, {e.ErrorContext.Path} {e.ErrorContext.Member}: {e.ErrorContext.Error.Message}");
 }
Example #26
0
        static void HandleError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs args, string context)
        {
            Log.Error($"JSON-related error ({context}): {args.ErrorContext.Error}");

            args.ErrorContext.Handled = true;
        }
Example #27
0
 /// <summary>
 ///   Metodo di supporto che serve per aiutare il serializzatore JSON a ignorare eventuali
 ///   errori riscontrati durante il processo di serializzazione.
 /// </summary>
 /// <param name="sender">L'oggetto che ha prodotto l'errore.</param>
 /// <param name="errorArgs">Il contesto in cui รจ avvenuto l'errore.</param>
 private static void IgnoreJsonSerializationError(object sender, ErrorEventArgs errorArgs)
 {
     errorArgs.ErrorContext.Handled = true;
 }
Example #28
0
 private void Error(object sender, ErrorEventArgs errorEventArgs)
 {
     _errors.Add(errorEventArgs);
     errorEventArgs.ErrorContext.Handled = true;
 }
Example #29
0
 private static void Error(object sender, ErrorEventArgs errorEventArgs)
 {
     Errors.Add(errorEventArgs);
     errorEventArgs.ErrorContext.Handled = true;
 }
Example #30
0
 private static void OnSerializationError(Newtonsoft.Json.Serialization.ErrorEventArgs args)
 {
     Diagnostics.Debug.WriteLine(args.ErrorContext.Error.Message);
     args.ErrorContext.Handled = true;
 }
Example #31
0
 private static void IgnoreDeserializationError(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs errorArgs)
 {
     Logger.Log(errorArgs.ErrorContext.Error.Message);
     errorArgs.ErrorContext.Handled = true;
 }
Example #32
0
 private void Serializer_Error(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs e)
 {
     e.ErrorContext.Handled = true;
 }
 private static void SuppressErrors(object sender, ErrorEventArgs e)
 {
     e.ErrorContext.Handled = true;
 }
Example #34
0
 internal void OnError(Newtonsoft.Json.Serialization.ErrorEventArgs e)
 {
     this.Error?.Invoke(this, e);
 }
 static void OnError(object sender, ErrorEventArgs e) {
     e.ToString();
 }
 private void DeserializationErrorHandler(object sender, ErrorEventArgs errorArgs)
 {
     errorArgs.ErrorContext.Handled = true;
 }
 /// <summary>
 /// Error handler for json deserialization errors.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The <see cref="ErrorEventArgs"/> instance containing the event data.</param>
 protected virtual void HandleJsonSerializationError(object sender, ErrorEventArgs args)
 {
     this.Logger.Error(
         args.ErrorContext.Error,
         Strings.DefaultJsonSerializerSettingsProvider_ErrorOnSerializingObjectMessage,
         args.CurrentObject?.GetType());
 }