< Summary

Information
Class: Ice.FacetNotExistException
Assembly: Ice
File(s): /_/csharp/src/Ice/LocalExceptions.cs
Tag: 91_21789722663
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 976
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Total methods: 3
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
.ctor(...)100%11100%
ice_id()100%11100%

File(s)

/_/csharp/src/Ice/LocalExceptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3#nullable enable
 4
 5using System.Diagnostics;
 6using System.Net;
 7
 8namespace Ice;
 9
 10// This file contains all the exception classes derived from LocalException defined in the Ice assembly.
 11
 12//
 13// Dispatch exceptions
 14//
 15
 16/// <summary>
 17/// The dispatch failed. This is the base class for local exceptions that can be marshaled and transmitted "over the
 18/// wire".
 19/// You can throw this exception in the implementation of an operation, or in a middleware. The Ice runtime then
 20/// logically rethrows this exception to the client.
 21/// </summary>
 22public class DispatchException : LocalException
 23{
 24    /// <summary>
 25    /// Gets the reply status.
 26    /// </summary>
 27    public ReplyStatus replyStatus { get; }
 28
 29    /// <summary>
 30    /// Initializes a new instance of the <see cref="DispatchException" /> class.
 31    /// </summary>
 32    /// <param name="replyStatus">The reply status. It must be greater than <see cref="ReplyStatus.UserException" />.
 33    /// </param>
 34    /// <param name="message">The exception message.</param>
 35    /// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="replyStatus" /> is equal to <see
 36    /// cref="ReplyStatus.Ok" /> or <see cref="ReplyStatus.UserException" />.</exception>
 37    public DispatchException(ReplyStatus replyStatus, string? message = null)
 38        : base(message ?? $"The dispatch failed with reply status {replyStatus}.") =>
 39        this.replyStatus = replyStatus > ReplyStatus.UserException && (byte)replyStatus <= 255 ? replyStatus :
 40            throw new ArgumentOutOfRangeException(
 41                nameof(replyStatus),
 42                $"The reply status of a {nameof(DispatchException)} must fit in a byte and be greater than {nameof(Reply
 43
 44    /// <inheritdoc/>
 45    public override string ice_id() => "::Ice::DispatchException";
 46}
 47
 48/// <summary>
 49/// The base exception for the 3 NotExist exceptions.
 50/// </summary>
 51public class RequestFailedException : DispatchException
 52{
 53    /// <summary>
 54    /// Gets the identity of the Ice Object to which the request was sent.
 55    /// </summary>
 56    public Identity id { get; }
 57
 58    /// <summary>
 59    /// Gets the facet to which the request was sent.
 60    /// </summary>
 61    public string facet { get; }
 62
 63    /// <summary>
 64    /// Gets the operation name of the request.
 65    /// </summary>
 66    public string operation { get; }
 67
 68    /// <summary>
 69    /// Initializes a new instance of the <see cref="RequestFailedException" /> class.
 70    /// </summary>
 71    /// <param name="replyStatus">The reply status.</param>
 72    /// <param name="id">The identity of the Ice Object to which the request was sent.</param>
 73    /// <param name="facet">The facet to which the request was sent.</param>
 74    /// <param name="operation">The operation name of the request.</param>
 75    private protected RequestFailedException(
 76        ReplyStatus replyStatus,
 77        Identity id,
 78        string facet,
 79        string operation)
 80        : base(replyStatus, createMessage(replyStatus, id, facet, operation))
 81    {
 82        Debug.Assert(replyStatus is ReplyStatus.ObjectNotExist or
 83            ReplyStatus.FacetNotExist or
 84            ReplyStatus.OperationNotExist);
 85        this.id = id;
 86        this.facet = facet;
 87        this.operation = operation;
 88    }
 89
 90    /// <summary>
 91    /// Initializes a new instance of the <see cref="RequestFailedException" /> class.
 92    /// </summary>
 93    /// <param name="replyStatus">The reply status.</param>
 94    private protected RequestFailedException(ReplyStatus replyStatus)
 95        : base(replyStatus)
 96    {
 97        Debug.Assert(replyStatus is ReplyStatus.ObjectNotExist or
 98            ReplyStatus.FacetNotExist or
 99            ReplyStatus.OperationNotExist);
 100
 101        id = new Identity();
 102        facet = "";
 103        operation = "";
 104    }
 105
 106    private static string createMessage(ReplyStatus replyStatus, Identity id, string facet, string operation) =>
 107        $"Dispatch failed with {replyStatus} {{ id = '{Util.identityToString(id)}', facet = '{facet}', operation = '{ope
 108}
 109
 110/// <summary>
 111/// The dispatch could not find a servant for the identity carried by the request.
 112/// </summary>
 113public sealed class ObjectNotExistException : RequestFailedException
 114{
 115    /// <summary>
 116    /// Initializes a new instance of the <see cref="ObjectNotExistException" /> class.
 117    /// </summary>
 118    public ObjectNotExistException()
 119        : base(ReplyStatus.ObjectNotExist)
 120    {
 121    }
 122
 123    /// <summary>
 124    /// Initializes a new instance of the <see cref="ObjectNotExistException" /> class.
 125    /// </summary>
 126    /// <param name="id">The identity of the Ice Object to which the request was sent.</param>
 127    /// <param name="facet">The facet to which the request was sent.</param>
 128    /// <param name="operation">The operation name of the request.</param>
 129    public ObjectNotExistException(Identity id, string facet, string operation)
 130        : base(ReplyStatus.ObjectNotExist, id, facet, operation)
 131    {
 132    }
 133
 134    /// <inheritdoc/>
 135    public override string ice_id() => "::Ice::ObjectNotExistException";
 136}
 137
 138/// <summary>
 139/// The dispatch could not find a servant for the identity + facet carried by the request.
 140/// </summary>
 141public sealed class FacetNotExistException : RequestFailedException
 142{
 143    /// <summary>
 144    /// Initializes a new instance of the <see cref="FacetNotExistException" /> class.
 145    /// </summary>
 146    public FacetNotExistException()
 1147        : base(ReplyStatus.FacetNotExist)
 148    {
 1149    }
 150
 151    /// <summary>
 152    /// Initializes a new instance of the <see cref="FacetNotExistException" /> class.
 153    /// </summary>
 154    /// <param name="id">The identity of the Ice Object to which the request was sent.</param>
 155    /// <param name="facet">The facet to which the request was sent.</param>
 156    /// <param name="operation">The operation name of the request.</param>
 157    public FacetNotExistException(Identity id, string facet, string operation)
 1158        : base(ReplyStatus.FacetNotExist, id, facet, operation)
 159    {
 1160    }
 161
 162    /// <inheritdoc/>
 1163    public override string ice_id() => "::Ice::FacetNotExistException";
 164}
 165
 166/// <summary>
 167/// The dispatch could not find the operation carried by the request on the target servant. This is typically due
 168/// to a mismatch in the Slice definitions, such as the client using Slice definitions newer than the server's.
 169/// </summary>
 170public sealed class OperationNotExistException : RequestFailedException
 171{
 172    /// <summary>
 173    /// Initializes a new instance of the <see cref="OperationNotExistException" /> class.
 174    /// </summary>
 175    public OperationNotExistException()
 176        : base(ReplyStatus.OperationNotExist)
 177    {
 178    }
 179
 180    /// <summary>
 181    /// Initializes a new instance of the <see cref="OperationNotExistException" /> class.
 182    /// </summary>
 183    /// <param name="id">The identity of the Ice Object to which the request was sent.</param>
 184    /// <param name="facet">The facet to which the request was sent.</param>
 185    /// <param name="operation">The operation name of the request.</param>
 186    public OperationNotExistException(Identity id, string facet, string operation)
 187        : base(ReplyStatus.OperationNotExist, id, facet, operation)
 188    {
 189    }
 190
 191    /// <inheritdoc/>
 192    public override string ice_id() => "::Ice::OperationNotExistException";
 193}
 194
 195/// <summary>
 196/// The exception that is thrown when a dispatch failed with an exception that is not a LocalException or a
 197/// UserException. This is the fallback exception when reporting a dispatch failure.
 198/// </summary>
 199/// <remarks>This exception is equivalent to a <see cref="DispatchException" /> with reply status
 200/// <see cref="ReplyStatus.UnknownException"/>.</remarks>
 201public class UnknownException : DispatchException
 202{
 203    /// <summary>
 204    /// Initializes a new instance of the <see cref="UnknownException" /> class.
 205    /// </summary>
 206    /// <param name="message">The exception message.</param>
 207    public UnknownException(string message)
 208        : base(ReplyStatus.UnknownException, message)
 209    {
 210    }
 211
 212    /// <inheritdoc/>
 213    public override string ice_id() => "::Ice::UnknownException";
 214
 215    /// <summary>
 216    /// Initializes a new instance of the <see cref="UnknownException" /> class.
 217    /// </summary>
 218    /// <param name="replyStatus">The reply status.</param>
 219    /// <param name="message">The exception message.</param>
 220    private protected UnknownException(ReplyStatus replyStatus, string message)
 221        : base(replyStatus, message)
 222    {
 223    }
 224}
 225
 226/// <summary>
 227/// The dispatch failed with a <see cref="LocalException" /> that is not a <see cref="DispatchException" /> .
 228/// </summary>
 229/// <remarks>This exception is equivalent to a <see cref="DispatchException" /> with reply status
 230/// <see cref="ReplyStatus.UnknownLocalException"/>.</remarks>
 231public sealed class UnknownLocalException : UnknownException
 232{
 233    /// <summary>
 234    /// Initializes a new instance of the <see cref="UnknownLocalException" /> class.
 235    /// </summary>
 236    /// <param name="message">The exception message.</param>
 237    public UnknownLocalException(string message)
 238        : base(ReplyStatus.UnknownLocalException, message)
 239    {
 240    }
 241
 242    /// <inheritdoc/>
 243    public override string ice_id() => "::Ice::UnknownLocalException";
 244}
 245
 246/// <summary>
 247/// A client received a <see cref="UserException" /> that was not declared in the operation's exception
 248/// specification.
 249/// </summary>
 250/// <remarks>This exception is thrown by the generated code for Slice proxies. The server-side generated code does not
 251/// enforce the exception specifications of operations and as a result does not throw this exception.</remarks>
 252/// <remarks>This exception is equivalent to a <see cref="DispatchException" /> with reply status
 253/// <see cref="ReplyStatus.UnknownUserException"/>.</remarks>
 254public sealed class UnknownUserException : UnknownException
 255{
 256    /// <summary>
 257    /// Initializes a new instance of the <see cref="UnknownUserException" /> class from a user exception type ID.
 258    /// </summary>
 259    /// <param name="typeId">The type ID.</param>
 260    /// <returns>The new instance of the <see cref="UnknownUserException" /> class.</returns>
 261    public static UnknownUserException fromTypeId(string typeId) =>
 262        new($"The reply carries a user exception that does not conform to the operation's exception specification: {type
 263
 264    /// <summary>
 265    /// Initializes a new instance of the <see cref="UnknownUserException" /> class.
 266    /// </summary>
 267    /// <param name="message">The exception message.</param>
 268    public UnknownUserException(string message)
 269        : base(ReplyStatus.UnknownUserException, message)
 270    {
 271    }
 272
 273    /// <inheritdoc/>
 274    public override string ice_id() => "::Ice::UnknownUserException";
 275}
 276
 277//
 278// Protocol exceptions
 279//
 280
 281/// <summary>
 282/// The base class for exceptions related to the Ice protocol.
 283/// </summary>
 284public class ProtocolException : LocalException
 285{
 286    /// <summary>
 287    /// Initializes a new instance of the <see cref="ProtocolException" /> class.
 288    /// </summary>
 289    /// <param name="message">The exception message.</param>
 290    /// <param name="innerException">The inner exception.</param>
 291    public ProtocolException(string message, System.Exception? innerException = null)
 292        : base(message, innerException)
 293    {
 294    }
 295
 296    /// <inheritdoc/>
 297    public override string ice_id() => "::Ice::ProtocolException";
 298}
 299
 300/// <summary>
 301/// This exception indicates that the connection has been gracefully closed by the server.
 302/// The operation call that caused this exception has not been executed by the server. In most cases you will not get
 303/// this exception because the client will automatically retry the operation call in case the server shut down the
 304/// connection. However, if upon retry the server shuts down the connection again, and the retry limit has been reached,
 305/// then this exception is propagated to the application code.
 306/// </summary>
 307public sealed class CloseConnectionException : ProtocolException
 308{
 309    /// <summary>
 310    /// Initializes a new instance of the <see cref="CloseConnectionException" /> class.
 311    /// </summary>
 312    public CloseConnectionException()
 313        : base("Connection closed by the peer.")
 314    {
 315    }
 316
 317    /// <inheritdoc/>
 318    public override string ice_id() => "::Ice::CloseConnectionException";
 319}
 320
 321/// <summary>
 322/// A datagram exceeds the configured size.
 323/// This exception is raised if a datagram exceeds the configured send or receive buffer size, or exceeds the maximum
 324/// payload size of a UDP packet (65507 bytes).
 325/// </summary>
 326public sealed class DatagramLimitException : ProtocolException
 327{
 328    /// <summary>
 329    /// Initializes a new instance of the <see cref="DatagramLimitException" /> class.
 330    /// </summary>
 331    public DatagramLimitException()
 332        : base("Datagram limit exceeded.")
 333    {
 334    }
 335
 336    /// <inheritdoc/>
 337    public override string ice_id() => "::Ice::DatagramLimitException";
 338}
 339
 340/// <summary>
 341/// This exception reports an error during marshaling or unmarshaling.
 342/// </summary>
 343public sealed class MarshalException : ProtocolException
 344{
 345    /// <summary>
 346    /// Initializes a new instance of the <see cref="MarshalException" /> class.
 347    /// </summary>
 348    /// <param name="message">The exception message.</param>
 349    /// <param name="innerException">The inner exception.</param>
 350    public MarshalException(string message, System.Exception? innerException = null)
 351        : base(message, innerException)
 352    {
 353    }
 354
 355    /// <inheritdoc/>
 356    public override string ice_id() => "::Ice::MarshalException";
 357}
 358
 359//
 360// Timeout exceptions
 361//
 362
 363/// <summary>
 364/// This exception indicates a timeout condition.
 365/// </summary>
 366public class TimeoutException : LocalException
 367{
 368    /// <summary>
 369    /// Initializes a new instance of the <see cref="TimeoutException" /> class.
 370    /// </summary>
 371    /// <param name="message">The exception message or null to use the default message.</param>
 372    public TimeoutException(string? message = null)
 373        : base(message ?? "Operation timed out.")
 374    {
 375    }
 376
 377    /// <inheritdoc/>
 378    public override string ice_id() => "::Ice::TimeoutException";
 379}
 380
 381/// <summary>
 382/// This exception indicates a connection closure timeout condition.
 383/// </summary>
 384public sealed class CloseTimeoutException : TimeoutException
 385{
 386    /// <summary>
 387    /// Initializes a new instance of the <see cref="CloseTimeoutException" /> class.
 388    /// </summary>
 389    public CloseTimeoutException()
 390        : base("Close timed out.")
 391    {
 392    }
 393
 394    /// <inheritdoc/>
 395    public override string ice_id() => "::Ice::CloseTimeoutException";
 396}
 397
 398/// <summary>
 399/// This exception indicates a connection establishment timeout condition.
 400/// </summary>
 401public sealed class ConnectTimeoutException : TimeoutException
 402{
 403    /// <summary>
 404    /// Initializes a new instance of the <see cref="ConnectTimeoutException" /> class.
 405    /// </summary>
 406    public ConnectTimeoutException()
 407        : base("Connect timed out.")
 408    {
 409    }
 410
 411    /// <inheritdoc/>
 412    public override string ice_id() => "::Ice::ConnectTimeoutException";
 413}
 414
 415/// <summary>
 416/// This exception indicates that an invocation failed because it timed out.
 417/// </summary>
 418public sealed class InvocationTimeoutException : TimeoutException
 419{
 420    /// <summary>
 421    /// Initializes a new instance of the <see cref="InvocationTimeoutException" /> class.
 422    /// </summary>
 423    public InvocationTimeoutException()
 424        : base("Invocation timed out.")
 425    {
 426    }
 427
 428    /// <inheritdoc/>
 429    public override string ice_id() => "::Ice::InvocationTimeoutException";
 430}
 431
 432//
 433// Syscall exceptions
 434//
 435
 436/// <summary>
 437/// This exception is raised if a system error occurred in the server or client process.
 438/// </summary>
 439public class SyscallException : LocalException
 440{
 441    /// <summary>
 442    /// Initializes a new instance of the <see cref="SyscallException" /> class.
 443    /// </summary>
 444    /// <param name="message">The exception message.</param>
 445    /// <param name="innerException">The inner exception.</param>
 446    public SyscallException(string? message, System.Exception? innerException = null)
 447        : base(message, innerException)
 448    {
 449    }
 450
 451    /// <summary>
 452    /// Initializes a new instance of the <see cref="SyscallException" /> class.
 453    /// </summary>
 454    /// <param name="innerException">The inner exception.</param>
 455    public SyscallException(System.Exception innerException)
 456        : this(message: null, innerException)
 457    {
 458    }
 459
 460    /// <inheritdoc/>
 461    public override string ice_id() => "::Ice::SyscallException";
 462}
 463
 464/// <summary>
 465/// This exception indicates a DNS problem.
 466/// </summary>
 467public sealed class DNSException : SyscallException
 468{
 469    /// <summary>
 470    /// Initializes a new instance of the <see cref="DNSException" /> class.
 471    /// </summary>
 472    /// <param name="host">The host name that could not be resolved.</param>
 473    /// <param name="innerException">The inner exception.</param>
 474    public DNSException(string host, System.Exception? innerException = null)
 475        : base($"Cannot resolve host '{host}'", innerException)
 476    {
 477    }
 478
 479    /// <inheritdoc/>
 480    public override string ice_id() => "::Ice::DNSException";
 481}
 482
 483/// <summary>
 484/// This exception indicates a file error occurred.
 485/// </summary>
 486public sealed class FileException : SyscallException
 487{
 488    /// <summary>
 489    /// Initializes a new instance of the <see cref="FileException" /> class.
 490    /// </summary>
 491    /// <param name="message">The exception message.</param>
 492    /// <param name="innerException">The inner exception.</param>
 493    public FileException(string message, System.Exception innerException)
 494        : base(message, innerException)
 495    {
 496    }
 497
 498    /// <inheritdoc/>
 499    public override string ice_id() => "::Ice::FileException";
 500}
 501
 502//
 503// Socket exceptions
 504//
 505
 506/// <summary>
 507/// This exception indicates a socket error.
 508/// </summary>
 509public class SocketException : SyscallException
 510{
 511    /// <summary>
 512    /// Initializes a new instance of the <see cref="SocketException" /> class.
 513    /// </summary>
 514    /// <param name="message">The exception message.</param>
 515    /// <param name="innerException">The inner exception.</param>
 516    public SocketException(string? message, System.Exception? innerException = null)
 517        : base(message, innerException)
 518    {
 519    }
 520
 521    /// <summary>
 522    /// Initializes a new instance of the <see cref="SocketException" /> class.
 523    /// </summary>
 524    /// <param name="innerException">The inner exception.</param>
 525    public SocketException(System.Exception? innerException = null)
 526        : base(message: null, innerException)
 527    {
 528    }
 529
 530    /// <inheritdoc/>
 531    public override string ice_id() => "::Ice::SocketException";
 532}
 533
 534/// <summary>
 535/// This exception indicates a connection failure.
 536/// </summary>
 537public class ConnectFailedException : SocketException
 538{
 539    /// <summary>
 540    /// Initializes a new instance of the <see cref="ConnectFailedException" /> class.
 541    /// </summary>
 542    /// <param name="peerAddress">The address of the remote peer, if known.</param>
 543    /// <param name="innerException">The inner exception.</param>
 544    public ConnectFailedException(EndPoint? peerAddress, System.Exception? innerException = null)
 545        : base(peerAddress is not null ? $"Failed to connect to {peerAddress}." : null, innerException)
 546    {
 547    }
 548
 549    /// <inheritdoc/>
 550    public override string ice_id() => "::Ice::ConnectFailedException";
 551}
 552
 553/// <summary>
 554/// This exception indicates a lost connection.
 555/// </summary>
 556public sealed class ConnectionLostException : SocketException
 557{
 558    /// <summary>
 559    /// Initializes a new instance of the <see cref="ConnectionLostException" /> class.
 560    /// </summary>
 561    /// <param name="peerAddress">The address of the remote peer, if known.</param>
 562    /// <param name="innerException">The inner exception.</param>
 563    public ConnectionLostException(EndPoint? peerAddress, System.Exception? innerException = null)
 564        : base(peerAddress is not null ? $"Lost connection to {peerAddress}." : null, innerException)
 565    {
 566    }
 567
 568    /// <inheritdoc/>
 569    public override string ice_id() => "::Ice::ConnectionLostException";
 570}
 571
 572/// <summary>
 573/// This exception indicates a connection failure for which the server host actively refuses a connection.
 574/// </summary>
 575public sealed class ConnectionRefusedException : ConnectFailedException
 576{
 577    /// <summary>
 578    /// Initializes a new instance of the <see cref="ConnectionRefusedException" /> class.
 579    /// </summary>
 580    /// <param name="serverAddress">The address of the remote server, if known.</param>
 581    /// <param name="innerException">The inner exception.</param>
 582    public ConnectionRefusedException(EndPoint? serverAddress, System.Exception? innerException = null)
 583        : base(serverAddress, innerException)
 584    {
 585    }
 586
 587    /// <inheritdoc/>
 588    public override string ice_id() => "::Ice::ConnectionRefusedException";
 589}
 590
 591//
 592// Other leaf local exceptions in alphabetical order.
 593//
 594
 595/// <summary>
 596/// An attempt was made to register something more than once with the Ice run time.
 597/// This exception is raised if an attempt is made to register a servant, servant locator, facet, object adapter (etc.)
 598/// more than once for the same ID.
 599/// </summary>
 600public sealed class AlreadyRegisteredException : LocalException
 601{
 602    /// <summary>
 603    /// Gets the kind of object that was already registered.
 604    /// </summary>
 605    public string kindOfObject { get; }
 606
 607    /// <summary>
 608    /// Gets the ID or name of the object that was already registered.
 609    /// </summary>
 610    public string id { get; }
 611
 612    /// <summary>
 613    /// Initializes a new instance of the <see cref="AlreadyRegisteredException" /> class.
 614    /// </summary>
 615    /// <param name="kindOfObject">The kind of object that was already registered.</param>
 616    /// <param name="id">The ID or name of the object that was already registered.</param>
 617    public AlreadyRegisteredException(string kindOfObject, string id)
 618        : base($"Another {kindOfObject} is already registered with ID '{id}'.")
 619    {
 620        this.kindOfObject = kindOfObject;
 621        this.id = id;
 622    }
 623
 624    /// <inheritdoc/>
 625    public override string ice_id() => "::Ice::AlreadyRegisteredException";
 626}
 627
 628/// <summary>
 629/// This exception is raised if the Communicator has been destroyed.
 630/// </summary>
 631public sealed class CommunicatorDestroyedException : LocalException
 632{
 633    /// <summary>
 634    /// Initializes a new instance of the <see cref="CommunicatorDestroyedException" /> class.
 635    /// </summary>
 636    public CommunicatorDestroyedException()
 637        : base("Communicator destroyed.")
 638    {
 639    }
 640
 641    /// <inheritdoc/>
 642    public override string ice_id() => "::Ice::CommunicatorDestroyedException";
 643}
 644
 645/// <summary>
 646/// This exception indicates that a connection was closed forcefully.
 647/// </summary>
 648public sealed class ConnectionAbortedException : LocalException
 649{
 650    /// <summary>
 651    /// Gets a value indicating whether the connection was aborted by the application.
 652    /// </summary>
 653    /// <value><see langword="true"/> if the connection was aborted by the application;
 654    /// otherwise, <see langword="false"/>.</value>
 655    public bool closedByApplication { get; }
 656
 657    /// <summary>
 658    /// Initializes a new instance of the <see cref="ConnectionAbortedException" /> class.
 659    /// </summary>
 660    /// <param name="message">The exception message.</param>
 661    /// <param name="closedByApplication">A value indicating whether the connection was aborted by the application.
 662    /// </param>
 663    public ConnectionAbortedException(string message, bool closedByApplication)
 664        : base(message) =>
 665        this.closedByApplication = closedByApplication;
 666
 667    /// <inheritdoc/>
 668    public override string ice_id() => "::Ice::ConnectionAbortedException";
 669}
 670
 671/// <summary>
 672/// This exception indicates that a connection was closed gracefully.
 673/// </summary>
 674public sealed class ConnectionClosedException : LocalException
 675{
 676    /// <summary>
 677    /// Gets a value indicating whether the connection was closed by the application.
 678    /// </summary>
 679    /// <value><see langword="true"/> if the connection was closed by the application;
 680    /// otherwise, <see langword="false"/>.</value>
 681    public bool closedByApplication { get; }
 682
 683    /// <summary>
 684    /// Initializes a new instance of the <see cref="ConnectionClosedException" /> class.
 685    /// </summary>
 686    /// <param name="message">The exception message.</param>
 687    /// <param name="closedByApplication">A value indicating whether the connection was closed by the application.
 688    /// </param>
 689    public ConnectionClosedException(string message, bool closedByApplication)
 690        : base(message) =>
 691        this.closedByApplication = closedByApplication;
 692
 693    /// <inheritdoc/>
 694    public override string ice_id() => "::Ice::ConnectionClosedException";
 695}
 696
 697/// <summary>
 698/// This exception is raised if an unsupported feature is used.
 699/// </summary>
 700public sealed class FeatureNotSupportedException : LocalException
 701{
 702    /// <summary>
 703    /// Initializes a new instance of the <see cref="FeatureNotSupportedException" /> class.
 704    /// </summary>
 705    /// <param name="message">The exception message.</param>
 706    public FeatureNotSupportedException(string message)
 707        : base(message)
 708    {
 709    }
 710
 711    /// <inheritdoc/>
 712    public override string ice_id() => "::Ice::FeatureNotSupportedException";
 713}
 714
 715/// <summary>
 716/// This exception indicates that an attempt has been made to change the connection properties of a fixed proxy.
 717/// </summary>
 718public sealed class FixedProxyException : LocalException
 719{
 720    /// <summary>
 721    /// Initializes a new instance of the <see cref="FixedProxyException" /> class.
 722    /// </summary>
 723    public FixedProxyException()
 724        : base("Cannot change the connection properties of a fixed proxy.")
 725    {
 726    }
 727
 728    /// <inheritdoc/>
 729    public override string ice_id() => "::Ice::FixedProxyException";
 730}
 731
 732/// <summary>
 733/// This exception is raised when a failure occurs during initialization.
 734/// </summary>
 735public sealed class InitializationException : LocalException
 736{
 737    /// <summary>
 738    /// Initializes a new instance of the <see cref="InitializationException" /> class.
 739    /// </summary>
 740    /// <param name="message">The exception message.</param>
 741    /// <param name="innerException">The inner exception.</param>
 742    public InitializationException(string message, System.Exception? innerException = null)
 743        : base(message, innerException)
 744    {
 745    }
 746
 747    /// <inheritdoc/>
 748    public override string ice_id() => "::Ice::InitializationException";
 749}
 750
 751/// <summary>
 752/// This exception indicates that an asynchronous invocation failed because it was canceled explicitly by the user.
 753/// </summary>
 754public sealed class InvocationCanceledException : LocalException
 755{
 756    /// <summary>
 757    /// Initializes a new instance of the <see cref="InvocationCanceledException" /> class.
 758    /// </summary>
 759    public InvocationCanceledException()
 760        : base("Invocation canceled.")
 761    {
 762    }
 763
 764    /// <inheritdoc/>
 765    public override string ice_id() => "::Ice::InvocationCanceledException";
 766}
 767
 768/// <summary>
 769/// This exception is raised if no suitable endpoint is available.
 770/// </summary>
 771public sealed class NoEndpointException : LocalException
 772{
 773    /// <summary>
 774    /// Initializes a new instance of the <see cref="NoEndpointException" /> class.
 775    /// </summary>
 776    /// <param name="message">The exception message.</param>
 777    public NoEndpointException(string message)
 778        : base(message)
 779    {
 780    }
 781
 782    /// <summary>
 783    /// Initializes a new instance of the <see cref="NoEndpointException" /> class.
 784    /// </summary>
 785    /// <param name="proxy">The proxy for which no suitable endpoint is available.</param>
 786    public NoEndpointException(ObjectPrx proxy)
 787        : base($"No suitable endpoint available for proxy '{proxy}'.")
 788    {
 789    }
 790
 791    /// <inheritdoc/>
 792    public override string ice_id() => "::Ice::NoEndpointException";
 793}
 794
 795/// <summary>
 796/// An attempt was made to find or deregister something that is not registered with Ice.
 797/// </summary>
 798public sealed class NotRegisteredException : LocalException
 799{
 800    /// <summary>
 801    /// Gets the kind of object that is not registered.
 802    /// </summary>
 803    public string kindOfObject { get; }
 804
 805    /// <summary>
 806    /// Gets the ID or name of the object that is not registered.
 807    /// </summary>
 808    public string id { get; }
 809
 810    /// <summary>
 811    /// Initializes a new instance of the <see cref="NotRegisteredException" /> class.
 812    /// </summary>
 813    /// <param name="kindOfObject">The kind of object that is not registered.</param>
 814    /// <param name="id">The ID or name of the object that is not registered.</param>
 815    public NotRegisteredException(string kindOfObject, string id)
 816       : base($"No {kindOfObject} is registered with ID '{id}'.")
 817    {
 818        this.kindOfObject = kindOfObject;
 819        this.id = id;
 820    }
 821
 822    /// <inheritdoc/>
 823    public override string ice_id() => "::Ice::NotRegisteredException";
 824}
 825
 826/// <summary>
 827/// This exception is raised if an attempt is made to use a deactivated ObjectAdapter.
 828/// </summary>
 829public sealed class ObjectAdapterDeactivatedException : LocalException
 830{
 831    /// <summary>
 832    /// Initializes a new instance of the <see cref="ObjectAdapterDeactivatedException" /> class.
 833    /// </summary>
 834    /// <param name="name">The name of the object adapter that is deactivated.</param>
 835    public ObjectAdapterDeactivatedException(string name)
 836        : base($"Object adapter '{name}' is deactivated.")
 837    {
 838    }
 839
 840    /// <inheritdoc/>
 841    public override string ice_id() => "::Ice::ObjectAdapterDeactivatedException";
 842}
 843
 844/// <summary>
 845/// This exception is raised if an attempt is made to use a destroyed ObjectAdapter.
 846/// </summary>
 847public sealed class ObjectAdapterDestroyedException : LocalException
 848{
 849    /// <summary>
 850    /// Initializes a new instance of the <see cref="ObjectAdapterDestroyedException" /> class.
 851    /// </summary>
 852    /// <param name="name">The name of the object adapter that is destroyed.</param>
 853    public ObjectAdapterDestroyedException(string name)
 854        : base($"Object adapter '{name}' is destroyed.")
 855    {
 856    }
 857
 858    /// <inheritdoc/>
 859    public override string ice_id() => "::Ice::ObjectAdapterDestroyedException";
 860}
 861
 862/// <summary>
 863/// This exception is raised if an ObjectAdapter cannot be activated.
 864/// This happens if the Locator detects another active ObjectAdapter with the same adapter ID.
 865/// </summary>
 866public sealed class ObjectAdapterIdInUseException : LocalException
 867{
 868    /// <summary>
 869    /// Initializes a new instance of the <see cref="ObjectAdapterIdInUseException" /> class.
 870    /// </summary>
 871    /// <param name="adapterId">The adapter ID that is already in use.</param>
 872    public ObjectAdapterIdInUseException(string adapterId)
 873        : base($"An object adapter with adapter ID '{adapterId}' is already active.")
 874    {
 875    }
 876
 877    /// <inheritdoc/>
 878    public override string ice_id() => "::Ice::ObjectAdapterIdInUseException";
 879}
 880
 881/// <summary>
 882/// Reports a failure that occurred while parsing a string.
 883/// </summary>
 884public sealed class ParseException : LocalException
 885{
 886    /// <summary>
 887    /// Initializes a new instance of the <see cref="ParseException" /> class.
 888    /// </summary>
 889    /// <param name="message">The exception message.</param>
 890    /// <param name="innerException">The inner exception.</param>
 891    public ParseException(string message, System.Exception? innerException = null)
 892        : base(message, innerException)
 893    {
 894    }
 895
 896    /// <inheritdoc/>
 897    public override string ice_id() => "::Ice::ParseException";
 898}
 899
 900/// <summary>
 901/// This exception indicates that a failure occurred while initializing a plug-in.
 902/// </summary>
 903public sealed class PluginInitializationException : LocalException
 904{
 905    /// <summary>
 906    /// Initializes a new instance of the <see cref="PluginInitializationException" /> class.
 907    /// </summary>
 908    /// <param name="message">The exception message.</param>
 909    /// <param name="innerException">The inner exception.</param>
 910    public PluginInitializationException(string message, System.Exception? innerException = null)
 911        : base(message, innerException)
 912    {
 913    }
 914
 915    /// <inheritdoc/>
 916    public override string ice_id() => "::Ice::PluginInitializationException";
 917}
 918
 919/// <summary>
 920/// This exception indicates a failure in a security subsystem.
 921/// </summary>
 922public sealed class SecurityException : LocalException
 923{
 924    /// <summary>
 925    /// Initializes a new instance of the <see cref="SecurityException" /> class.
 926    /// </summary>
 927    /// <param name="message">The exception message.</param>
 928    /// <param name="innerException">The inner exception.</param>
 929    public SecurityException(string message, System.Exception? innerException = null)
 930        : base(message, innerException)
 931    {
 932    }
 933
 934    /// <inheritdoc/>
 935    public override string ice_id() => "::Ice::SecurityException";
 936}
 937
 938/// <summary>
 939/// The operation can only be invoked with a two-way request.
 940/// This exception is raised if an attempt is made to invoke an operation with ice_oneway, ice_batchOneway,
 941/// ice_datagram, or ice_batchDatagram and the operation has a return value, out-parameters, or an exception
 942/// specification.
 943/// </summary>
 944public sealed class TwowayOnlyException : LocalException
 945{
 946    /// <summary>
 947    /// Initializes a new instance of the <see cref="TwowayOnlyException" /> class.
 948    /// </summary>
 949    /// <param name="operation">The operation name.</param>
 950    public TwowayOnlyException(string operation)
 951        : base($"Cannot invoke operation '{operation}' with a oneway, batchOneway, datagram, or batchDatagram proxy.")
 952    {
 953    }
 954
 955    public override string ice_id() => "::Ice::TwowayOnlyException";
 956}
 957
 958/// <summary>
 959/// This exception is raised when there is an error while getting or setting a property. For example, when
 960/// trying to set an unknown Ice property.
 961/// </summary>
 962public sealed class PropertyException : LocalException
 963{
 964    /// <summary>
 965    /// Initializes a new instance of the <see cref="PropertyException" /> class.
 966    /// </summary>
 967    /// <param name="message">The exception message.</param>
 968    /// <param name="innerException">The inner exception.</param>
 969    public PropertyException(string message, System.Exception? innerException = null)
 970        : base(message, innerException)
 971    {
 972    }
 973
 974    /// <inheritdoc/>
 975    public override string ice_id() => "::Ice::PropertyException";
 976}