Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions renderers/web_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
## 0.8.5

- Add `V8ErrorConstructor` interface to be able to access V8-only
`captureStackTrace` method in errors.

## 0.8.4

- Tweak v0.8 Schema for Button and TextField to better match the spec.

## 0.8.3

- The `MarkdownRenderer` type is now async and returns a `Promise<string>`.

## 0.8.2

## 0.8.1

## 0.8.0
2 changes: 1 addition & 1 deletion renderers/web_core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@a2ui/web_core",
"version": "0.8.4",
"version": "0.8.5",
"description": "A2UI Core Library",
"main": "./dist/src/v0_8/index.js",
"types": "./dist/src/v0_8/index.d.ts",
Expand Down
12 changes: 10 additions & 2 deletions renderers/web_core/src/v0_9/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
* limitations under the License.
*/

/**
* This interface is needed for typescript to allow us to access the V8-only
* `captureStackTrace` property in Errors.
*/
interface V8ErrorConstructor extends ErrorConstructor {
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
}

/**
* Base class for all A2UI specific errors.
*/
Expand All @@ -26,8 +34,8 @@ export class A2uiError extends Error {
this.code = code;

// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
if ((Error as V8ErrorConstructor).captureStackTrace) {
(Error as V8ErrorConstructor).captureStackTrace(this, this.constructor);
}
}
}
Expand Down
Loading