Пример #1
0
        public void SendAnonymousReportAsync(Exception exception, string toEmail, Guid?applicationId)
        {
            _sendRequestState = new SendRequestState
            {
                AnonymousData = new AnonymousData
                {
                    Exception     = exception,
                    ToEmail       = toEmail,
                    ApplicationID = applicationId
                }
            };

            _uploader.SendAnonymousReportCompleted += OnSendAnonymousReportCompleted;
            _uploader.SendAnonymousReportAsync(SendRequestState.GetClientLib(), _sendRequestState.GetApplication(), _sendRequestState.GetExceptionDescription(anonymous: true), _sendRequestState);
        }
Пример #2
0
        public void SendAnonymousReportAsync(Exception exception, string toEmail, Guid? applicationId)
        {
            _sendRequestState = new SendRequestState
            {
                AnonymousData = new AnonymousData
                {
                    Exception = exception,
                    ToEmail = toEmail,
                    ApplicationID = applicationId
                }
            };

            _uploader.SendAnonymousReportCompleted += OnSendAnonymousReportCompleted;
            _uploader.SendAnonymousReportAsync(SendRequestState.GetClientLib(), _sendRequestState.GetApplication(), _sendRequestState.GetExceptionDescription(anonymous: true), _sendRequestState);
        }
Пример #3
0
        public string SendReportSilently(Exception exception, string toEmail, Guid?applicationId, string developerMessage, string from,
                                         string userMessage, byte[] screenshot)
        {
            _sendRequestState = new SendRequestState
            {
                AnonymousData = new AnonymousData
                {
                    Exception     = exception,
                    ToEmail       = toEmail,
                    ApplicationID = applicationId
                },
                PrivateData = new PrivateData
                {
                    UserEmail        = from,
                    UserMessage      = userMessage,
                    DeveloperMessage = developerMessage,
                    Screenshot       = screenshot
                }
            };

            var response = _uploader.SendAnonymousReport(SendRequestState.GetClientLib(), _sendRequestState.GetApplication(),
                                                         _sendRequestState.GetExceptionDescription(true));

            if (response is ErrorResponse errorResponse)
            {
                throw new Exception(errorResponse.Error);
            }

            if (response is NeedReportResponse)
            {
                var additionalDataResponse = _uploader.SendAdditionalData(response.Context,
                                                                          _sendRequestState.GetDetailedExceptionDescription());
                if (additionalDataResponse is ErrorResponse errorAdditionalDataResponse)
                {
                    throw new Exception(errorAdditionalDataResponse.Error);
                }
                return(additionalDataResponse.UrlToProblem);
            }

            return(response.UrlToProblem);
        }