=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
/// Represents a generic response in the Universal Chess Interface (UCI) protocol, encapsulating a payload of type <typeparamref name="T"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the response payload.</typeparam>
|
||||
/// <!-- aidoc:v1 sig=edd025b -->
|
||||
public class UciResponse<T>
|
||||
{
|
||||
/// <summary>
|
||||
@@ -40,6 +41,7 @@ public class UciResponse<T>
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to include in the response payload.</param>
|
||||
/// <returns>A <see cref="UciResponse{T}"/> containing the provided entity.</returns>
|
||||
/// <!-- aidoc:v1 sig=193e85b body=f1d7691 -->
|
||||
public static UciResponse<T> FromSuccess(T entity)
|
||||
{
|
||||
return new UciResponse<T>(entity);
|
||||
@@ -51,6 +53,7 @@ public class UciResponse<T>
|
||||
/// </summary>
|
||||
/// <param name="ex">The exception whose type name and message are used to populate the error response.</param>
|
||||
/// <returns>A <see cref="UciResponse{T}"/> containing the cleaned exception type name and the exception message as the error details.</returns>
|
||||
/// <!-- aidoc:v1 sig=f4afb5b body=80d56b7 -->
|
||||
public static UciResponse<T> FromError(Exception ex)
|
||||
{
|
||||
var error = ex.GetType().Name;
|
||||
@@ -65,6 +68,7 @@ public class UciResponse<T>
|
||||
/// <param name="error">The error code or identifier describing the failure.</param>
|
||||
/// <param name="message">An optional human-readable message providing additional context about the error.</param>
|
||||
/// <returns>A <see cref="UciResponse{T}"/> with <c>Success</c> set to <c>false</c>, the specified <paramref name="error"/>, and the optional <paramref name="message"/>.</returns>
|
||||
/// <!-- aidoc:v1 sig=43834ba body=b488e43 -->
|
||||
public static UciResponse<T> FromError(string error, string? message = null)
|
||||
{
|
||||
return new UciResponse<T>
|
||||
|
||||
Reference in New Issue
Block a user