Files
lmxopcua/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS/Wire/FocasWireException.cs
Joseph Doherty a25593a9c6 chore: organize solution into module folders (Core/Server/Drivers/Client/Tooling)
Group all 69 projects into category subfolders under src/ and tests/ so the
Rider Solution Explorer mirrors the module structure. Folders: Core, Server,
Drivers (with a nested Driver CLIs subfolder), Client, Tooling.

- Move every project folder on disk with git mv (history preserved as renames).
- Recompute relative paths in 57 .csproj files: cross-category ProjectReferences,
  the lib/ HintPath+None refs in Driver.Historian.Wonderware, and the external
  mxaccessgw refs in Driver.Galaxy and its test project.
- Rebuild ZB.MOM.WW.OtOpcUa.slnx with nested solution folders.
- Re-prefix project paths in functional scripts (e2e, compliance, smoke SQL,
  integration, install).

Build green (0 errors); unit tests pass. Docs left for a separate pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 01:55:28 -04:00

52 lines
1.9 KiB
C#

namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Wire;
/// <summary>
/// Thrown by the wire client when a FOCAS request fails — either at the protocol layer
/// (invalid PDU magic, desynchronised response framing, connection dropped mid-request)
/// or when the CNC returns a non-zero <c>EW_*</c> return code.
/// </summary>
/// <remarks>
/// <para>Callers distinguish the two classes via <see cref="IsTransient"/>: <c>true</c>
/// when the transport is gone (socket closed, timeout, cancellation mid-write) and the
/// wire client has already torn the sockets down, so a reconnect is required before any
/// further call. <c>false</c> for protocol-level errors where the connection is still
/// usable.</para>
/// <para><see cref="Rc"/> carries the wire-level FOCAS return code when the exception
/// came from a parsed response block. Null when the failure happened before a response
/// was received (e.g. connect-time handshake errors).</para>
/// </remarks>
public class FocasWireException : Exception
{
/// <summary>FOCAS <c>EW_*</c> return code from the response block, when available.</summary>
public short? Rc { get; }
/// <summary>
/// True when the transport was closed as a side effect of this failure — the caller
/// must reconnect before issuing the next request.
/// </summary>
public bool IsTransient { get; }
public FocasWireException(string message)
: base(message)
{
}
public FocasWireException(string message, short? rc, bool isTransient = false)
: base(message)
{
Rc = rc;
IsTransient = isTransient;
}
public FocasWireException(string message, Exception innerException)
: base(message, innerException)
{
}
public FocasWireException(string message, Exception innerException, bool isTransient)
: base(message, innerException)
{
IsTransient = isTransient;
}
}