googleapis / googleapis/nodejs-agentplatform

ClientError class missing code and status properties in stackTrace

Open
#432 0 comments 0 reactions 0 assignees View on GitHub
api: aiplatform priority: p2 type: bug
Dominant language
TypeScript
Stars
182
Forks
69
Avg merge
1d 8h
Merged PRs (30d)
10

Description

The `ClientError` class in the Vertex AI SDK doesn't include `code` and `status` properties in its type definition, despite these properties being present in the actual error object thrown by the API.

## Current Behavior
The `ClientError` class is defined as:

```typescript
declare class ClientError extends Error {
readonly stackTrace?: Error;
constructor(message: string, stackTrace?: Error);
}
```

However, when catching errors from the API, the actual error object includes a stackTrace property with code and status:
```typescript
{
"name": "ClientError",
"stackTrace": {
"code": 400,
"status": "INVALID_ARGUMENT"
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.