fix(pouchdb-errors): guard Error.stack access when stack is inaccessible#9193
fix(pouchdb-errors): guard Error.stack access when stack is inaccessible#9193Mayankaggarwal8055 wants to merge 7 commits intoapache:masterfrom
Conversation
|
The current codebase does not define CustomPouchError, so only the stack-safety change from the reported patch was applicable. |
57e1780 to
f6fe588
Compare
1918749 to
acc8cb1
Compare
|
Hey @janl , could you please take a look at this when you get a moment? I’ve implemented the fix for handling Error.stack safely by wrapping it in a try/catch to avoid crashes in restricted environments. The change is minimal and keeps the existing behavior intact while making it more robust. Everything is working fine locally, and the fix directly addresses the issue discussed. Would really appreciate your feedback or any suggestions for improvement. Thanks! 🙌 |
Co-authored-by: Steven <SourceR85@users.noreply.github.com>
Co-authored-by: Steven <SourceR85@users.noreply.github.com>
Safely handle stack assignment with fallback message.
|
Should be fine. |
|
can you please reinstate our PR template and fill it out accordingly? |
This PR makes the error handling in
pouchdb-errorsmore robust.In some environments, accessing
Error.stackcan throw an exception. The previous implementation assumed that thestackproperty would always be accessible, which could cause the error handling itself to crash.This change wraps the stack assignment in a
try/catchblock and provides a safe fallback when the stack cannot be accessed. This ensures that error objects are still created properly even in restricted environments.Fixes #9067