Commit 8b01dbc4 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro
Browse files

(chore) do not capture sentry exception if error is not 500

parent a9eb22b0
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -61,6 +61,14 @@ class LogService {
    deviceLog.error(...args);
    deviceLog.error(...args);
  }
  }


  isApiError(error) {
    return error instanceof ApiError;
  }

  isUnexpectedError() {
    return !isNaN(error.status) && this.error.status >= 500;
  }

  exception(prepend, error) {
  exception(prepend, error) {


    if (!error) {
    if (!error) {
@@ -68,7 +76,7 @@ class LogService {
      prepend = null;
      prepend = null;
    }
    }


    if (!isNetworkFail(error) && !(error instanceof ApiError && error.status === 401)) {
    if (!isNetworkFail(error) && (!this.isApiError(error) || this.isUnexpectedError(error))) {
      // report the issue to sentry
      // report the issue to sentry
      Sentry.captureException(error);
      Sentry.captureException(error);
    }
    }