Project

General

Profile

« Previous | Next » 

Revision eb647d5e

Added by Leszek Koltunski over 2 years ago

Better error reporting.

View differences:

src/main/java/org/distorted/tutorials/TutorialObjectLibInterface.java
51 51

  
52 52
///////////////////////////////////////////////////////////////////////////////////////////////////
53 53

  
54
  public void reportProblem(String problem)
54
  public void reportProblem(String problem, boolean reportException)
55 55
    {
56 56
    if( BuildConfig.DEBUG )
57 57
      {
......
59 59
      }
60 60
    else
61 61
      {
62
      Exception ex = new Exception(problem);
63
      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
64
      crashlytics.setCustomKey("problem" , problem);
65
      crashlytics.recordException(ex);
62
      if( reportException )
63
        {
64
        Exception ex = new Exception(problem);
65
        FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
66
        crashlytics.setCustomKey("problem" , problem);
67
        crashlytics.recordException(ex);
68
        }
69
      else
70
        {
71
        FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
72
        crashlytics.log(problem);
73
        }
66 74
      }
67 75
    }
68 76

  

Also available in: Unified diff