Skip to content

Commit

Permalink
Add Sentry to get panic backtrace in Rust
Browse files Browse the repository at this point in the history
For nuances of Rust backtrace on iOS and Android, see: fzyzcjy/flutter_rust_bridge#1553 (comment)
  • Loading branch information
AlienKevin committed Jan 1, 2024
1 parent fbac795 commit 43513cc
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 15 deletions.
3 changes: 1 addition & 2 deletions lib/src/rust/api/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

Stream<String> createLogStream({dynamic hint}) =>
RustLib.instance.api.createLogStream(hint: hint);
Expand Down
6 changes: 2 additions & 4 deletions lib/src/rust/frb_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables

import 'api/api.dart';
import 'dart:async';
import 'dart:convert';

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

import 'api/api.dart';
import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

/// Main entrypoint of the Rust API
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
Expand Down
6 changes: 2 additions & 4 deletions lib/src/rust/frb_generated.io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables

import 'api/api.dart';
import 'dart:async';
import 'dart:convert';
import 'dart:ffi' as ffi;

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';

import 'api/api.dart';
import 'frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';

abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RustLibApiImplPlatform({
Expand Down
6 changes: 2 additions & 4 deletions lib/src/rust/frb_generated.web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables

import 'api/api.dart';
import 'dart:async';
import 'dart:convert';

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';

import 'api/api.dart';
import 'frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';

abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RustLibApiImplPlatform({
Expand Down
1 change: 1 addition & 0 deletions rust/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
sentry_dsn.txt
Loading

0 comments on commit 43513cc

Please sign in to comment.