HAKOM.ErrorHandling.Core.Net.Api Namespace
Contains the public API surface of the HAKOM error handling module.
Remarks
Section titled “Remarks”This namespace exposes the two pillars of HAKOM error handling:
- HakomException — The abstract base class for all HAKOM exceptions. Every exception carries a unique
error code (format
HK#####) and an equivalent HTTP status code. - Result / Result<TValue> — Discriminated-union-style types that represent either the success or the failure of an operation, enabling non-throwing error propagation through the Try/Result pattern.
Typical usage follows the Try/Result convention where a TryX method returns a
Result<TValue> and a convenience wrapper X calls
GetValueOrThrow() to produce a throwing API:
public interface IAttributeStore{ // Primary method - never throws, wraps errors in Result Task<Result<IAttribute>> TryLoad( string name, CancellationToken cancellationToken = default);
// Convenience wrapper - throws on failure Task<IAttribute> Load( string name, CancellationToken cancellationToken = default) => TryLoad(name, cancellationToken) .GetValueOrThrow();}| Classes | |
|---|---|
| HakomException | Abstract base class for all exceptions thrown by HAKOM software. |
| Result | Base class for result objects that represent either the success or the failure of a void operation. |
| Result<TValue> | Represents the result of an operation that is supposed to return a value of type TValue. |
Was this page helpful?Thanks for your feedback!