Exemplo n.º 1
0
        /// <summary>
        /// Reports the specified rollbar logger.
        /// </summary>
        /// <param name="rollbarLogger">The rollbar logger.</param>
        /// <param name="dataObject">The data object.</param>
        /// <param name="rollbarError">The rollbar error.</param>
        /// <param name="message">The message.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="errorCollector">The error collector.</param>
        public static void Report(
            IRollbar?rollbarLogger,
            object?dataObject,
            InternalRollbarError rollbarError,
            string?message,
            Exception?exception,
            IErrorCollector?errorCollector
            )
        {
            var rollbarException = new RollbarException(rollbarError, message ?? rollbarError.ToString(), exception);

            errorCollector?.Register(rollbarException);

            var rollbarEvent = new InternalErrorEventArgs(rollbarLogger, dataObject, rollbarException, rollbarException.Message);


            if (rollbarLogger is RollbarLogger specificRollbarLogger)
            {
                specificRollbarLogger.OnRollbarEvent(rollbarEvent);
            }
            else
            {
                RollbarQueueController.Instance?.OnRollbarEvent(rollbarEvent);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets the rollbar package.
 /// </summary>
 /// <returns>IRollbarPackage.</returns>
 private IRollbarPackage GetRollbarPackage()
 {
     if (this._rollbarPackage == null)
     {
         this._rollbarPackage = CreateRollbarPackage(this._payloadObject);
         if (this._rollbarPackage != null)
         {
             IErrorCollector packageErrorCollector = this._rollbarPackage as IErrorCollector;
             if (packageErrorCollector != null)
             {
                 foreach (var exception in this._bundleErrorCollector.Exceptions)
                 {
                     packageErrorCollector.Register(exception);
                 }
             }
         }
     }
     this._rollbarPackage = ApplyConfigPackageDecorator(this._rollbarPackage);
     return(this._rollbarPackage);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Reports the specified rollbar logger.
        /// </summary>
        /// <param name="rollbarLogger">The rollbar logger.</param>
        /// <param name="dataObject">The data object.</param>
        /// <param name="rollbarError">The rollbar error.</param>
        /// <param name="message">The message.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="errorCollector">The error collector.</param>
        public static void Report(
            RollbarLogger rollbarLogger,
            object dataObject,
            InternalRollbarError rollbarError,
            string message,
            Exception exception,
            IErrorCollector errorCollector
            )
        {
            var rollbarException = new RollbarException(rollbarError, message ?? rollbarError.ToString(), exception);

            errorCollector?.Register(rollbarException);

            var rollbarEvent = new InternalErrorEventArgs(rollbarLogger, dataObject, rollbarException, rollbarException.Message);

            if (rollbarLogger != null)
            {
                rollbarLogger.OnRollbarEvent(rollbarEvent);
            }
            else
            {
                RollbarQueueController.Instance.OnRollbarEvent(rollbarEvent);
            }
        }