catchSupabaseException static method

void catchSupabaseException(
  1. Object error,
  2. StackTrace stacktrace
)

Implementation

static void catchSupabaseException(Object error, StackTrace stacktrace) {
  StudyUDiagnostics.captureException(error, stackTrace: stacktrace);
  if (error is PostgrestException) {
    StudyULogger.fatal(
      'Caught Postgrest Error: $error\nStacktrace: $stacktrace',
    );
    throw error;
  } else if (error is SocketException) {
    // StudyULogger.info("App is suspected to be offline");
    throw error;
  } else {
    StudyULogger.fatal('Caught Supabase Error: $error');
    throw error;
  }
}