Skip to content

Commit 8070c89

Browse files
authored
fix: support recordError with falsy Error (#253)
## Summary Support calling `LDObserve.recordError` with falsy value without causing an error. ## How did you test this change? CI ## Are there any deployment considerations? no <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Ensure `recordError` handles nullish values by defaulting to `new Error('Unknown error')`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d63bee4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 8ed78e1 commit 8070c89

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sdk/highlight-run/src/sdk/observe.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ export class ObserveSDK implements Observe {
254254
source?: string,
255255
type?: ErrorMessageType,
256256
) {
257+
error = error || new Error('Unknown error')
257258
if (error instanceof Error && error.cause) {
258259
payload = {
259260
...payload,

0 commit comments

Comments
 (0)