# AgentErrorDiagnostic

Package: `@threadplane/core` · 0.3.7

Reference: /docs/api/core/AgentErrorDiagnostic

```typescript
import type { AgentErrorDiagnostic } from '@threadplane/core';
```

## AgentErrorDiagnostic

What a failure was classified from, described as plain data for logs,
telemetry and debug views. Published beside the error, in a snapshot's
`errorDiagnostic`, so `AgentError` stays a display projection. It is a description, never the thrown value: no
prototype, no functions, and nested causes described the same way.

```typescript
export interface AgentErrorDiagnostic  {
  readonly cause?: AgentErrorDiagnostic;
  readonly code?: string | number;
  readonly data?: PlainValue;
  readonly message: string;
  readonly name?: string;
  readonly stack?: string;
  readonly status?: number;
}
```

### cause

The thrown value's own `cause`, described the same way.

```typescript
readonly cause?: AgentErrorDiagnostic;
```

### code

A machine code the thrown value carried, such as `ECONNRESET`.

```typescript
readonly code?: string | number;
```

### data

Any further plain data the thrown value carried, or the value itself when it was plain data.

```typescript
readonly data?: PlainValue;
```

### message

```typescript
readonly message: string;
```

### name

The thrown value's `name`, such as `TypeError`.

```typescript
readonly name?: string;
```

### stack

```typescript
readonly stack?: string;
```

### status

An HTTP status the thrown value carried.

```typescript
readonly status?: number;
```