Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception is not getting in try catch block #289

Closed
ilyasarafath opened this issue Mar 22, 2024 · 3 comments
Closed

Exception is not getting in try catch block #289

ilyasarafath opened this issue Mar 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ilyasarafath
Copy link

Version

3.0.0

Library

feedback_sentry

Flutter channel

stable

Flutter version

3.19.2

Platform

Android, iOS

Details

Am using feedback_sentry package to capture user feed and send to Sentry, The internal exception is not caught in the catch block
try { BetterFeedback.of(context).showAndUploadToSentry( name: "Test", email: AppConstants.supportMail, ); } catch (_) { //exception not catching here }

Steps to reproduce

  1. Without initialising the sentry try call "showAndUploadToSentry" method
    2.This time internal exception will trigger, but not getting exception in "catch" block

Output of flutter doctor -v

[✓] Flutter (Channel stable, 3.19.2, on macOS 14.3.1 23D60 darwin-arm64, locale en-IN)
    • Flutter version 3.19.2 on channel stable at /Users/ilyasarafath/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7482962148 (3 weeks ago), 2024-02-27 16:51:22 -0500
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/ilyasarafath/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/ilyasarafath/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (3 available)            
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 14 (API 34)
      (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 14.3.1 23D60
      darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome
      123.0.6312.58

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@ilyasarafath ilyasarafath added the bug Something isn't working label Mar 22, 2024
@ueman
Copy link
Owner

ueman commented Mar 22, 2024

This kind of try catch will never work due to how this code and Flutter fundamentally works. So unfortunately I can't do anything

@ueman ueman closed this as completed Mar 22, 2024
@ilyasarafath
Copy link
Author

ilyasarafath commented Mar 22, 2024

Is it possible return "true" or "false" from this function "showAndUploadToSentry" based on the result?

@ueman
Copy link
Owner

ueman commented Mar 22, 2024

For any customization beyond the default API you have to go custom. Then you can catch exceptions, know the result and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants