Skip to content

Commit

Permalink
Merge pull request #1663 from ardriveapp/dev
Browse files Browse the repository at this point in the history
PE-5771: Release ArDrive v2.37.3
  • Loading branch information
thiagocarvalhodev authored Mar 11, 2024
2 parents 848bef2 + 038d674 commit 33e6d6a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/authentication/ardrive_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:ardrive/utils/constants.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:ardrive/utils/metadata_cache.dart';
import 'package:ardrive/utils/secure_key_value_store.dart';
import 'package:ardrive_logger/ardrive_logger.dart';
import 'package:arweave/arweave.dart';
import 'package:arweave/utils.dart';
import 'package:cryptography/cryptography.dart';
Expand Down Expand Up @@ -349,7 +350,7 @@ class ArDriveAuthImpl implements ArDriveAuth {
}
}

class AuthenticationFailedException implements Exception {
class AuthenticationFailedException implements UntrackedException {
final String message;

AuthenticationFailedException(this.message);
Expand All @@ -358,7 +359,7 @@ class AuthenticationFailedException implements Exception {
String toString() => message;
}

class WalletMismatchException implements Exception {
class WalletMismatchException implements UntrackedException {
const WalletMismatchException();
}

Expand All @@ -368,6 +369,6 @@ class AuthenticationUnknownException implements Exception {
AuthenticationUnknownException(this.message);
}

class AuthenticationUserIsNotLoggedInException implements Exception {
class AuthenticationUserIsNotLoggedInException implements UntrackedException {
const AuthenticationUserIsNotLoggedInException();
}
3 changes: 2 additions & 1 deletion lib/entities/entity.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:convert';

import 'package:ardrive/core/crypto/crypto.dart';
import 'package:ardrive_logger/ardrive_logger.dart';
import 'package:ardrive_utils/ardrive_utils.dart';
import 'package:arweave/arweave.dart';
import 'package:cryptography/cryptography.dart';
Expand Down Expand Up @@ -192,7 +193,7 @@ abstract class EntityWithCustomMetadata extends Entity {
}
}

class EntityTransactionParseException implements Exception {
class EntityTransactionParseException implements UntrackedException {
final String transactionId;

EntityTransactionParseException({required this.transactionId});
Expand Down
1 change: 1 addition & 0 deletions packages/ardrive_logger/lib/ardrive_logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ library ardrive_logger;

export 'src/logger.dart';
export 'src/sentry.dart';
export 'src/untracked_exception.dart';
7 changes: 7 additions & 0 deletions packages/ardrive_logger/lib/src/logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:collection';
import 'dart:convert';

import 'package:ardrive_io/ardrive_io.dart';
import 'package:ardrive_logger/src/untracked_exception.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_email_sender/flutter_email_sender.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Expand Down Expand Up @@ -76,6 +77,12 @@ class Logger {
}

log(LogLevel.error, errorMessage);

if (error is UntrackedException) {
/// Do not send untracked exceptions to Sentry
return;
}

Sentry.captureException(error ?? message, stackTrace: stackTrace);
}

Expand Down
1 change: 1 addition & 0 deletions packages/ardrive_logger/lib/src/untracked_exception.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract class UntrackedException implements Exception {}

0 comments on commit 33e6d6a

Please sign in to comment.