Skip to main content

Description

LckResult is the standard return type for LckService operations. Instead of throwing exceptions, methods return this structured result containing a success flag, optional error code, descriptive message, and the operation’s value. It serves the same purpose as Result<T> in LckCore but is used by the higher-level service layer.

Usage

Use LckResult whenever you call an LckService method. Always check Success before accessing the value.
var result = _lckService.GetDescriptor();

if (result.Success)
{
    Debug.Log($"Descriptor: {result.Result}");
}
else
{
    Debug.LogError($"Failed ({result.Error}): {result.Message}");
}

References

Properties

NameTypeDescription
SuccessboolIndicates whether the operation was successful.
MessagestringProvides an optional message, typically used for error information.
ErrorLckError?Contains the error code or type if the operation failed.
ResultTThe result value of the operation if successful; default value of T otherwise.

See Also

  • Result<T> — Similar result type used by LckCore methods
  • LckError — Error codes returned in the Error property
  • LckService — Service class whose methods return LckResult