Skip to content

Conversation

@marandaneto
Copy link
Member

@marandaneto marandaneto commented Jan 7, 2026

💡 Motivation and Context

Closes #237
source code context not possible yet due to flutter/flutter#87734
also flutter/flutter#145111 but less of a blocker since it only is needed for not in app code

💚 How did you test it?

running example on prod
debug builds dont have chunk ids
Screenshot 2026-01-21 at 14 00 50

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@marandaneto marandaneto changed the title chore/exception web chore: exception web Jan 9, 2026
@marandaneto
Copy link
Member Author

still a few things to figure out eg https://posthog.slack.com/archives/C07AA937K9A/p1768489092736519?thread_ts=1768415443.965209&cid=C07AA937K9A
but ready for an early review @ioannisj
you can ignore the linter issues for now

true; // Capture isolate errors

await Posthog().setup(config);
if (kIsWeb) {
Copy link
Member Author

@marandaneto marandaneto Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web needs runZonedGuarded and mobile/desktop do not
we have to add docs for this

}
}

// Stack line parser type
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ported the code from the JS SDK since i could make it work reusing that part of the JS SDK because the error tracking bits is a plugin downloaded async and its never available when i want to
we can probably ditch this later if i manage to make it working

@marandaneto marandaneto requested a review from ioannisj January 21, 2026 16:46
@marandaneto marandaneto marked this pull request as ready for review January 21, 2026 16:47
@marandaneto marandaneto requested a review from a team as a code owner January 21, 2026 16:47
Comment on lines +177 to +183
/// Captures runZonedGuarded exceptions with optional custom properties
/// https://api.flutter.dev/flutter/dart-async/runZonedGuarded.html
///
/// [error] - The error/exception to capture
/// [stackTrace] - Optional stack trace (if not provided, current stack trace will be used)
/// [properties] - Optional custom properties to attach to the exception event
Future<void> captureRunZonedGuardedError(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ioannisj added this API so they can call this and we dont need to expose PostHogException

@marandaneto marandaneto requested review from a team and hpouillot January 21, 2026 17:01
@marandaneto marandaneto requested review from ablaszkiewicz and oliverb123 and removed request for oliverb123 January 21, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter web error tracking support

3 participants