captureSdkException function
Implementation
Future<void> captureSdkException(
dynamic error, {
StackTrace? stackTrace,
String? reason,
}) async {
// ignore: invalid_use_of_internal_member
final isSentryConfigured = HubAdapter().options.dsn?.isNotEmpty == true;
if (!isSentryConfigured) {
debugPrint('[BeMall SDK] Erro: $error\nSentry não está configurado.');
return;
}
try {
await Sentry.captureException(
error,
stackTrace: stackTrace ?? StackTrace.current,
hint: reason != null ? Hint() : null,
);
debugPrint('[BeMall SDK] Erro enviado ao Sentry com sucesso.');
} catch (e) {
debugPrint('[BeMall SDK] Falha ao capturar erro com Sentry: $e');
}
}