Class OmieFaultClassifier
Classifies Omie failure messages so callers can react programmatically (e.g. switch an OS create to an
update when the integration code already exists) instead of string-matching Omie text themselves. This
component surfaces faults as failed IResult (it deliberately does not throw — see the
comment on OmieApiClient._staticClient), so the markers live here in one place.
VERIFY (Omie test app): confirm the exact faultstring wording for the duplicate-integration-code and not-found cases against the current Omie responses and adjust the markers below if needed.
public static class OmieFaultClassifier
- Inheritance
-
OmieFaultClassifier
- Inherited Members
Methods
DescribeThrottle(string?)
A message for the end user about a throttled call, preserving the wait Omie reported when there is one. Telling someone to wait is a different instruction from telling them to fix something, which is why the refusal is worth distinguishing.
public static string DescribeThrottle(string? message)
Parameters
messagestring
Returns
IsDuplicateIntegrationCode(IResult)
Convenience overload over a failed IResult.
public static bool IsDuplicateIntegrationCode(IResult result)
Parameters
resultIResult
Returns
IsDuplicateIntegrationCode(string?)
True when the failure indicates the integration code (cCodIntOS) already exists in Omie.
public static bool IsDuplicateIntegrationCode(string? message)
Parameters
messagestring
Returns
IsMissingOrderIdentification(IResult)
Convenience overload over a failed IResult.
public static bool IsMissingOrderIdentification(IResult result)
Parameters
resultIResult
Returns
IsMissingOrderIdentification(string?)
True when AlterarOS refused the change claiming the OS identification tags were not informed. Intermittent: the same body, byte for byte, has been accepted and refused by Omie minutes apart. Retrying later is the only remedy — but not immediately, since an identical repeated call is what Omie punishes as redundant consumption.
public static bool IsMissingOrderIdentification(string? message)
Parameters
messagestring
Returns
IsNotFound(IResult)
Convenience overload over a failed IResult.
public static bool IsNotFound(IResult result)
Parameters
resultIResult
Returns
IsNotFound(string?)
True when the failure indicates the requested record was not found in Omie.
public static bool IsNotFound(string? message)
Parameters
messagestring
Returns
IsThrottled(IResult)
Convenience overload over a failed IResult.
public static bool IsThrottled(IResult result)
Parameters
resultIResult
Returns
IsThrottled(string?)
True when Omie refused the call to control consumption rather than because of the request itself — either a redundant call (the same parameters again within about a minute) or an app key temporarily blocked for excessive calls. Neither is fixed by changing the request: only by waiting.
public static bool IsThrottled(string? message)
Parameters
messagestring