dolittle/DotNET.SDK

View on GitHub
Source/Services/CannotEnumerateServerStreamingCallMultipleTimes.cs

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;

namespace Dolittle.SDK.Services;

/// <summary>
/// Exception that gets thrown when <see cref="IAsyncEnumerable{TServerMessage}.GetAsyncEnumerator"/> is called multiple times.
/// </summary>
public class CannotEnumerateServerStreamingCallMultipleTimes : Exception
{
    /// <summary>
    /// Initializes a new instance of the <see cref="CannotEnumerateServerStreamingCallMultipleTimes"/> class.
    /// </summary>
    public CannotEnumerateServerStreamingCallMultipleTimes()
        : base($"Cannot enumerate {typeof(IServerStreamingEnumerable<>).Name} multiple times.")
    {
    }
}