Description
Result<T> is the standard return type for all LckCore operations. Instead of throwing exceptions, methods like Initialize(), HasUserConfiguredStreaming(), IsUserSubscribed(), and StartLoginAttemptAsync() return a Result<T> that wraps either a success value or an error with a message.
This gives you consistent, predictable error handling across the entire SDK without try/catch blocks.
Usage
UseResult<T> whenever you call an LckCore method. Always check IsOk before accessing the value.
References
Properties
| Property | Type | Description |
|---|---|---|
| IsOk | bool | Indicates whether the operation was successful. Always check this first. |
| Message | string | Error message when the operation fails. null if successful. |
| Err | CoreError ? | High-level error category (e.g., InternalError, InvalidArgument). null if successful. |
| Ok | T | The result value on success. Returns default(T) (e.g., null, 0, or false) if IsOk == false. |
Methods
| Method | Returns | Description |
|---|---|---|
static Result<T> NewSuccess(T result) | Result<T> | Creates a result representing a successful operation and wraps the returned value. |
static Result<T> NewError(CoreError error, string message) | Result<T> | Creates a result representing a failed operation, with an error type and descriptive message. |