Files

33 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Classes/Connection/NotConnectedException.cs
generated_at: "2026-04-16T02:39:10.292945+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "ebd03ba552c1193d"
---
# Connection
1. **Purpose**
This module defines a custom exception type, `NotConnectedException`, used to signal operations that are attempted on a connection object when no active connection is established. It resides in the `DTS.Common.Classes.Connection` namespace, indicating its role in the common core infrastructure for managing connection state across the DTS system. Its purpose is to provide a semantically precise exception for connection-state violations, distinguishing them from generic `ApplicationException` or `InvalidOperationException` cases.
2. **Public Interface**
- **`NotConnectedException(string message)`**
Constructor that initializes the exception with a specified error message. It delegates to the base `ApplicationException` constructor. No additional properties or methods are exposed beyond those inherited from `Exception`.
3. **Invariants**
- The exception inherits all standard `Exception` invariants (e.g., `Message`, `StackTrace`, `InnerException` behavior).
- The exception is *only* intended for use when an operation requires an active connection but none exists; it is not a general-purpose connection error.
- No validation or state management is performed by this class itself—it is a passive data carrier.
4. **Dependencies**
- **Depends on**: `System.ApplicationException` (from `mscorlib`/`System.Runtime`).
- **Used by**: Presumably connection-handling classes (e.g., `Connection`, `Client`, or `Session` types in the `DTS.Common.Classes.Connection` namespace or related modules), though these are not visible in this file.
- **Not used by**: No other code in this file; this is a standalone type definition.
5. **Gotchas**
- `ApplicationException` is deprecated in modern .NET best practices (replaced by `Exception` or more specific built-in exceptions like `InvalidOperationException`), suggesting this may be legacy code or part of an older design pattern.
- The class provides no additional context (e.g., connection ID, endpoint, or timestamp), so callers must embed such details in the `message` string if needed for diagnostics.
- No serialization support is explicitly implemented (e.g., `[Serializable]` attribute or custom `GetObjectData`), though `ApplicationException` itself is serializable by default in .NET Framework—behavior may differ in .NET Core/.NET 5+.
- None identified from source alone.