// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
namespace WixToolset.Mba.Host
{
using System;
using System.Runtime.Serialization;
///
/// Base class for exception returned to the bootstrapper application host.
///
[Serializable]
public abstract class BootstrapperException : Exception
{
///
/// Creates an instance of the base class with the given HRESULT.
///
/// The HRESULT for the exception that is used by the bootstrapper application host.
public BootstrapperException(int hr)
{
this.HResult = hr;
}
///
/// Initializes a new instance of the class.
///
/// Exception message.
public BootstrapperException(string message)
: base(message)
{
}
///
/// Initializes a new instance of the class.
///
/// Exception message
/// Inner exception associated with this one
public BootstrapperException(string message, Exception innerException)
: base(message, innerException)
{
}
///
/// Initializes a new instance of the class.
///
/// Serialization information for this exception
/// Streaming context to serialize to
protected BootstrapperException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
///
/// The bootstrapper application assembly loaded by the host does not contain exactly one instance of the
/// class.
///
///
[Serializable]
public class MissingAttributeException : BootstrapperException
{
///
/// Creates a new instance of the class.
///
public MissingAttributeException()
: base(NativeMethods.E_NOTFOUND)
{
}
///
/// Initializes a new instance of the class.
///
/// Exception message.
public MissingAttributeException(string message)
: base(message)
{
}
///
/// Initializes a new instance of the class.
///
/// Exception message
/// Inner exception associated with this one
public MissingAttributeException(string message, Exception innerException)
: base(message, innerException)
{
}
///
/// Initializes a new instance of the class.
///
/// Serialization information for this exception
/// Streaming context to serialize to
protected MissingAttributeException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
///
/// The bootstrapper application factory specified by the
/// does not extend the base class.
///
///
///
[Serializable]
public class InvalidBootstrapperApplicationFactoryException : BootstrapperException
{
///
/// Creates a new instance of the class.
///
public InvalidBootstrapperApplicationFactoryException()
: base(NativeMethods.E_UNEXPECTED)
{
}
///
/// Initializes a new instance of the class.
///
/// Exception message.
public InvalidBootstrapperApplicationFactoryException(string message)
: base(message)
{
}
///
/// Initializes a new instance of the class.
///
/// Exception message
/// Inner exception associated with this one
public InvalidBootstrapperApplicationFactoryException(string message, Exception innerException)
: base(message, innerException)
{
}
///
/// Initializes a new instance of the class.
///
/// Serialization information for this exception
/// Streaming context to serialize to
protected InvalidBootstrapperApplicationFactoryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}