Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/wrap-record-save-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stackflow/plugin-stack-persistence": patch
---

Wrap storage save failures in `StackSnapshotRecordSaveError` before invoking `onRecordSaveError` or rethrowing, matching the declared handler signature and the load-path behavior.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ export function stackPersistencePlugin<Metadata>(
snapshot,
metadata
}).catch(error => {
if (onRecordSaveError) return onRecordSaveError(error);
else throw error;
const saveError = new StackSnapshotRecordSaveError(error);

if (onRecordSaveError) return onRecordSaveError(saveError);
else throw saveError;
});
}

Expand Down
Loading