@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Interface TaskResultFailure<T>

    Task failed — error is always present.

    interface TaskResultFailure<T> {
        metadata: TaskResultMetadata;
        governance?: GovernanceCheckResult;
        governanceOutcome?: GovernanceOutcome;
        governanceOutcomeError?: string;
        conversation?: Message[];
        debug_logs?: any[];
        match?: <R>(
            handlers: MatchHandlers<T, R> | PartialMatchHandlers<T, R>,
        ) => R;
        success: false;
        status: "failed" | "governance-denied";
        data?: T;
        error: string;
        adcpError?: AdcpErrorInfo;
        errorInstance?: ADCPError;
        correlationId?: string;
        deferred?: undefined;
        submitted?: undefined;
    }

    Type Parameters

    • T

    Hierarchy

    • TaskResultBase<T>
      • TaskResultFailure
    Index

    Properties

    Governance check result (present when governance is configured)

    governanceOutcome?: GovernanceOutcome

    Governance outcome (present after successful execution with governance)

    governanceOutcomeError?: string

    Error message when governance outcome reporting failed

    conversation?: Message[]

    Full conversation history

    debug_logs?: any[]

    Debug logs (if debug enabled)

    match?: <R>(handlers: MatchHandlers<T, R> | PartialMatchHandlers<T, R>) => R

    Exhaustive pattern match on the result's status. Prefer this method form — it autocompletes alongside the other TaskResult accessors.

    The free function import('./match').match is also exported for compositional use (e.g., point-free style or when the result type is not yet narrowed).

    Attached non-enumerably by the client when the result is returned from executeTask. Results constructed by hand (e.g., in test fixtures or custom middleware) will not have this method — use the free function, or call attachMatch(result) first.

    success: false
    status: "failed" | "governance-denied"
    data?: T

    Response payload with structured error details (adcp_error, context, ext)

    error: string

    Human-readable error message

    adcpError?: AdcpErrorInfo

    Structured AdCP error (code, recovery, suggestion, retryAfterMs)

    errorInstance?: ADCPError

    Typed ADCPError subclass instance when the seller's error code has a dedicated class — currently IdempotencyConflictError and IdempotencyExpiredError. Lets callers write if (result.errorInstance instanceof IdempotencyConflictError) instead of switching on adcpError.code strings. Absent for codes without a typed mapping.

    correlationId?: string

    Correlation ID from the error response context, for tracing across agents

    deferred?: undefined
    submitted?: undefined