Table of Contents

InternalServerErrorException Class

Definition

Namespace
Cuemon.AspNetCore.Http
Assemblies
Cuemon.AspNetCore.dll
Source
src/Cuemon.AspNetCore/Http/InternalServerErrorException.cs

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
object
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

Name Description
InternalServerErrorException()

Initializes a new instance of the InternalServerErrorException class.

InternalServerErrorException(Exception)

Initializes a new instance of the InternalServerErrorException class.

InternalServerErrorException(string, Exception)

Initializes a new instance of the InternalServerErrorException class.

See Also