GithubHelp home page GithubHelp logo

Comments (7)

pesterhazy avatar pesterhazy commented on May 28, 2024 2

Just wanted to drop a note that 2.7.0 has fixed the issue for us - many thanks!

from react-native-exception-handler.

a7ul avatar a7ul commented on May 28, 2024

Ok. How about this . So currently to customise native Exception handling we have a function mentioned at this part of the README
Modifying iOS Native Exception handler UI (NATIVE CODE HAS TO BE WRITTEN) recommended that you do this in XCode

Maybe we can add a extra parameter to the block that is passed to
ReactNativeExceptionHandler replaceNativeExceptionHandlerBlock

Currently it takes a block that accepts two parameters replaceNativeExceptionHandlerBlock:^(NSException *exception, NSString *readeableException)
Maybe we can add another parameter to it like so


replaceNativeExceptionHandlerBlock:^(NSException *exception, NSString *readeableException, int signal){
if(signal === SIGPIPE){
//ignore and do nothing
}else{
//show popup 
}
}

So If anyone wants to handle/ignore any custom signal, then they can do so inside this callback itself.
So essentially
When SIGPIPE occurs the custom block specified by the user will be called and they can choose to handle/ignore it safely.

What do you say ? @pesterhazy

from react-native-exception-handler.

pesterhazy avatar pesterhazy commented on May 28, 2024

Sounds like a good general solution. Two comments:

  • It would be great if there was a way to call the original error handler, so we don't have to copy and paste the UIAlertController call (not necessary of course, I'm just reluctant to copy and paste too much)
  • Perhaps it would be a good default to ignore SIGPIPE, which can be considered an informational signal. For iOS apps, IMO it usually doesn't make sense to crash as a response to it

For reference, here are a few links discussing SIGPIPE on iOS:

from react-native-exception-handler.

a7ul avatar a7ul commented on May 28, 2024

Okay . So I think i will remove the SIGPIPE handler all together. What do you think ?

from react-native-exception-handler.

pesterhazy avatar pesterhazy commented on May 28, 2024

from react-native-exception-handler.

pesterhazy avatar pesterhazy commented on May 28, 2024

To add one more data point in support of remove the SIGPIPE handler, attaching a debugger it looks like in our app the SIGPIPE occurs within UIKit, so this probably affects a lot of people, not just those with native code added.

from react-native-exception-handler.

a7ul avatar a7ul commented on May 28, 2024

Release v2.7.0 - It has the fix for this.
Thanks @pesterhazy

from react-native-exception-handler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.