Path: redb-route/redb.Route.As4/Exceptions/As4SignalExceptions.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.As4/Exceptions/As4SignalExceptions.cs
----
namespace redb.Route.As4;
///
/// The partner answered our message with an ebMS error of severity failure. Carries the partner's
/// code and texts as sent; a route handles it with OnException<As4ErrorSignalException>().
///
public sealed class As4ErrorSignalException : Exception
{
/// Creates the exception from the partner's error.
public As4ErrorSignalException(string messageId, string errorCode, string? shortDescription, string? description, string? detail)
: base($"The partner refused AS4 message '{messageId}' with {errorCode} {shortDescription}: {description ?? detail}")
{
MessageId = messageId;
ErrorCode = errorCode;
ShortDescription = shortDescription;
Description = description;
ErrorDetail = detail;
}
/// Our message the error refers to.
public string MessageId { get; }
/// The ebMS error code, e.g. EBMS:0010.
public string ErrorCode { get; }
/// eb:Error/@shortDescription.
public string? ShortDescription { get; }
/// eb:Error/eb:Description.
public string? Description { get; }
/// eb:Error/eb:ErrorDetail.
public string? ErrorDetail { get; }
}
///
/// No receipt proves that the partner received our message: none arrived (),
/// or the one that did is not valid for it (). This is the exception a route
/// redelivers on — OnException<As4ReceiptException>().MaximumRedeliveries(n) — and the message id stays
/// the same on every attempt, so the partner sees a resend, not a new message.
///
public sealed class As4ReceiptException : As4ProcessingException
{
/// Creates the exception.
public As4ReceiptException(As4ErrorCode code, string messageId, string detail, Exception? innerException = null)
: base(code, $"message '{messageId}': {detail}", innerException) => MessageId = messageId;
/// Our message the receipt was expected for.
public string MessageId { get; }
}