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

// Program.cs
using System;
using Cuemon.AspNetCore.Http;

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