using System; #if !NETSTANDARD1_3 using System.Runtime.Serialization; #endif using JavaScriptEngineSwitcher.Core.Constants; namespace JavaScriptEngineSwitcher.Core { /// /// The exception that occurred in the workings of the JS engine itself /// #if !NETSTANDARD1_3 [Serializable] #endif public class JsEngineException : JsException { /// /// Initializes a new instance of the class /// with a specified error message /// /// The message that describes the error public JsEngineException(string message) : base(message) { Category = JsErrorCategory.Engine; } /// /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception /// that is the cause of this exception /// /// The error message that explains the reason for the exception /// The exception that is the cause of the current exception public JsEngineException(string message, Exception innerException) : base(message, innerException) { Category = JsErrorCategory.Engine; } /// /// Initializes a new instance of the class /// /// The error message that explains the reason for the exception /// Name of JS engine /// Version of original JS engine public JsEngineException(string message, string engineName, string engineVersion) : base(message, engineName, engineVersion) { Category = JsErrorCategory.Engine; } /// /// Initializes a new instance of the class /// /// The error message that explains the reason for the exception /// Name of JS engine /// Version of original JS engine /// The exception that is the cause of the current exception public JsEngineException(string message, string engineName, string engineVersion, Exception innerException) : base(message, engineName, engineVersion, innerException) { Category = JsErrorCategory.Engine; } #if !NETSTANDARD1_3 /// /// Initializes a new instance of the class with serialized data /// /// The object that holds the serialized data /// The contextual information about the source or destination #if NET10_0_OR_GREATER [Obsolete(DiagnosticId = "SYSLIB0051")] #endif protected JsEngineException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif } }