question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Expose security framework result code when throwing error

See original GitHub issue

Hi there,

We saw a huge spike in Sentry about an error that this package throws on iOS. It’s weird since we haven’t upgrade this package. We did upgrade react native to 0.62.2 though.

Error getItem(react-native/Libraries/BatchedBridge/NativeModules) An error occured while retrieving value

I know this can happen, and it’s our mistake of not handling the error properly.

But, it would be very handy if the result code was shown in that error as well. That way we have a starting point for debugging purposes, since it’s not on a specific device, nor a specific iOS version, and it only started happening on our latest release.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
emeraldsantocommented, Jun 30, 2020

I’ve got the code up and running locally, I’ve tested by rejecting with arbitrary OSStatus members such as errSecNoSuchKeychain and the equivalent code (-25294) was sent back to JS in the error.code property. I then used osstatus.com to search for the code and check if the results matched the native error.

This experiment was successful and you can expect a release tomorrow morning, or rather afternoon in Belgium 😅

2reactions
emeraldsantocommented, Jun 29, 2020

Hi! I’ve also been using this in production for a while now without this kind of incident. I’m sorry to hear that you’ve been facing some problems using this library.

I can definitely look into forwarding this kind of info though. I’m wondering if the base AsyncStorage module does this or not.

Regardless, it should be an easy fix and I’ll try to release a new version in the upcoming days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Security Framework Result Codes - Documentation
Evaluate result codes common to many Security framework functions. ... The requested name isn't allowed for this certificate.
Read more >
Error Handling - OWASP Cheat Sheet Series
Error handling is a part of the overall security of an application. ... may be prudent to return 4xx error codes, when we...
Read more >
How to Write Helpful Error Messages to Improve Your App's ...
The key is an error code, and the value is a corresponding message. The error codes should be the same codes you receive...
Read more >
Clean Code and the Art of Exception Handling - Toptal
Clean Code and the Art of Exception Handling. Exceptions are as old as programming itself. An unhandled exception may cause unexpected behavior, and...
Read more >
Error monitoring and exception handling in large-scale ...
Learn how to handle errors and exceptions on large scale software projects, ... who will uncover bugs your team didn't catch and didn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found