Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
no empty value
  • Loading branch information
denrase committed May 30, 2023
commit ad2d60268c6fd09764fffbaf7931f1d04820fd1c
2 changes: 1 addition & 1 deletion dart/lib/src/sentry_exception_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SentryExceptionFactory {
// https://flutter.dev/docs/deployment/obfuscate#caveat
return SentryException(
type: (throwable.runtimeType).toString(),
value: value,
value: value.isNotEmpty ? value : null,
mechanism: mechanism,
stackTrace: sentryStackTrace,
throwable: throwable,
Expand Down
14 changes: 13 additions & 1 deletion dart/test/sentry_exception_factory_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ void main() {

expect(sentryException.value, expected);
});

test('no empty value', () {
final stackTraceError = StackTraceError();
stackTraceError.prefix = "";
final sentryException = fixture.getSut().getSentryException(stackTraceError,
stackTrace: StackTraceErrorStackTrace());

expect(sentryException.value, isNull);
});
}

class CustomError extends Error {}
Expand All @@ -198,10 +207,13 @@ class CustomExceptionStackTraceExtractor
}

class StackTraceError extends Error {

var prefix = "NetworkError(type: NetworkErrorType.unknown, error: Instance of 'iH')";

@override
String toString() {
return '''
NetworkError(type: NetworkErrorType.unknown, error: Instance of 'iH')
$prefix

pid: 9437, tid: 10069, name 1.ui
os: android arch: arm64 comp: yes sim: no
Expand Down