//#region src/utils/errors.d.ts /** * Whether the backend signalled that the requested resource does not exist. * Prefer `err instanceof ResourceNotFoundError`; this predicate also covers * raw `ConnectError`s (NotFound or the auth resource-not-found detail). */ declare function isResourceNotFoundError(err: unknown): boolean; /** Whether an optimistic-concurrency update used a stale resource revision. */ declare function isRevisionConflictError(err: unknown): boolean; /** Whether a policy mutation failed because the policy is still attached to a resource. */ declare function isPolicyInUseError(err: unknown): boolean; /** Whether a policy mutation failed because the policy is locked. */ declare function isPolicyLockedError(err: unknown): boolean; /** Whether the policy and target account belong to different scopes. */ declare function isPolicyScopeMismatchError(err: unknown): boolean; /** * Whether an error is retryable (network/timeout) for idempotent operations. * Uses same requestId on retry; backend dedupes within 2min. * Prefer `err instanceof TransientError` or `err.retryable` on typed errors. */ declare function isRetryableError(err: unknown): boolean; /** * Diagnostic formatter for SDK and ConnectRPC errors. * Typed SDK errors already carry normalized messages; for raw ConnectErrors * this strips leading "[CODE]" prefixes. Falls back to a friendly default. * The returned message may contain backend implementation details. Never render * it to a user; use {@link formatUserFacingError} at presentation boundaries. * @param err - The error to format. * @param fallback - The fallback message when no message is available. * @returns The formatted error message. */ declare function formatConnectError(err: unknown, fallback?: string): string; declare function formatUserFacingError(error: unknown, fallback: string): string; //#endregion export { formatConnectError, formatUserFacingError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError }; //# sourceMappingURL=errors.d.ts.map