Table of Contents

Class InternalServerErrorException

Namespace
Cuemon.AspNetCore.Http
Assembly
Cuemon.AspNetCore.dll

The exception that is thrown when the server has encountered a situation it does not know how to handle.

public class InternalServerErrorException : HttpStatusCodeException, ISerializable
Inheritance
InternalServerErrorException
Implements
Inherited Members

Examples

The following example demonstrates how to use InternalServerErrorException to represent an unexpected server-side failure in an exception handling middleware.

using System;

namespace Cuemon.AspNetCore.Http;

public static class InternalServerErrorExceptionExample
{
    public static void Demonstrate()
    {
        var failure = new InvalidOperationException("The invoice pipeline failed to commit the transaction.");
        var exception = new InternalServerErrorException(failure);

        Console.WriteLine(exception.StatusCode);
        Console.WriteLine(exception.InnerException?.Message);
    }
}

Constructors

InternalServerErrorException()

Initializes a new instance of the InternalServerErrorException class.

public InternalServerErrorException()

InternalServerErrorException(Exception)

Initializes a new instance of the InternalServerErrorException class.

public InternalServerErrorException(Exception innerException)

Parameters

innerException Exception

The exception that is the cause of the current exception.

InternalServerErrorException(string, Exception)

Initializes a new instance of the InternalServerErrorException class.

public InternalServerErrorException(string message, Exception innerException = null)

Parameters

message string

The message that describes the HTTP status code.

innerException Exception

The exception that is the cause of the current exception.

See Also