@temporalio/client
Version:
Temporal.io SDK Client sub-package
74 lines (73 loc) • 2.56 kB
TypeScript
import { ServiceError as GrpcServiceError } from '@grpc/grpc-js';
import { RetryState } from '@temporalio/common';
/**
* Generic Error class for errors coming from the service
*/
export declare class ServiceError extends Error {
readonly cause?: Error;
constructor(message: string, opts?: {
cause: Error;
});
}
/**
* Thrown by the client while waiting on Workflow execution result if execution
* completes with failure.
*
* The failure type will be set in the `cause` attribute.
*
* For example if the workflow is cancelled, `cause` will be set to
* {@link CancelledFailure}.
*/
export declare class WorkflowFailedError extends Error {
readonly cause: Error | undefined;
readonly retryState: RetryState;
constructor(message: string, cause: Error | undefined, retryState: RetryState);
}
/**
* Thrown by the client while waiting on Workflow Update result if Update
* completes with failure.
*/
export declare class WorkflowUpdateFailedError extends Error {
readonly cause: Error | undefined;
constructor(message: string, cause: Error | undefined);
}
/**
* Thrown by the client if the Update call timed out or was cancelled.
* This doesn't mean the update itself was timed out or cancelled.
*/
export declare class WorkflowUpdateRPCTimeoutOrCancelledError extends Error {
readonly cause?: Error;
constructor(message: string, opts?: {
cause: Error;
});
}
/**
* Thrown the by client while waiting on Workflow execution result if Workflow
* continues as new.
*
* Only thrown if asked not to follow the chain of execution (see {@link WorkflowOptions.followRuns}).
*/
export declare class WorkflowContinuedAsNewError extends Error {
readonly newExecutionRunId: string;
constructor(message: string, newExecutionRunId: string);
}
/**
* Returns true if the provided error is a {@link GrpcServiceError}.
*/
export declare function isGrpcServiceError(err: unknown): err is GrpcServiceError;
/**
* Returns true if the provided error or its cause is a {@link GrpcServiceError} with code DEADLINE_EXCEEDED.
*
* @see {@link Connection.withDeadline}
*/
export declare function isGrpcDeadlineError(err: unknown): err is Error;
/**
* Returns true if the provided error or its cause is a {@link GrpcServiceError} with code CANCELLED.
*
* @see {@link Connection.withAbortSignal}
*/
export declare function isGrpcCancelledError(err: unknown): err is Error;
/**
* @deprecated Use `isGrpcServiceError` instead
*/
export declare const isServerErrorResponse: typeof isGrpcServiceError;