コード例 #1
0
ファイル: Client.cs プロジェクト: derigel23/JetBox
        public void LogException(DropboxException exception)
        {
            if ((exception is DropboxRestException) && ((DropboxRestException) exception).StatusCode == HttpStatusCode.Unauthorized)
            return;

            Logger.LogExceptionSilently(exception);
        }
コード例 #2
0
ファイル: DbUploader.cs プロジェクト: pcrockett/Ruminate
 private void reportError(DropboxException ex)
 {
     _dispatcher.BeginInvoke(() =>
         {
             var han = Error;
             if (han != null)
                 han(ex.Message);
         });
 }
コード例 #3
0
ファイル: Client.cs プロジェクト: nategreenwood/JetBox
        public void LogException(DropboxException exception)
        {
            switch (exception.StatusCode)
              {
            case HttpStatusCode.Unauthorized:
              break;

            default:
              myLogger.LogExceptionSilently(exception);
              break;
              }
        }
コード例 #4
0
ファイル: List.xaml.cs プロジェクト: oldlaurel/WinPass
        private void OnFileDownloadFailed(DropboxException obj)
        {
            Dispatcher.BeginInvoke(() =>
            {
                progBusy.IsBusy = false;

                MessageBox.Show(
                    DropBoxResources.DownloadError,
                    DropBoxResources.ListTitle,
                    MessageBoxButton.OK);
            });
        }
コード例 #5
0
ファイル: DropBox.xaml.cs プロジェクト: nthobois/7Pass
        private void LoginFailed(DropboxException ex)
        {
            Dispatcher.BeginInvoke(() =>
            {
                progBusy.IsBusy = false;

                MessageBox.Show(DropBoxResources.LoginFailure,
                    DropBoxResources.LoginTitle,
                    MessageBoxButton.OK);

                txtEmail.Focus();
                txtEmail.SelectAll();
            });
        }
コード例 #6
0
        void OnFail(DropboxException ed)
        {
            Utilities.ShowProgressIndicator(false);
            Uploading = false;
            switch (ed.StatusCode)
            {
                case HttpStatusCode.NotFound:
                case HttpStatusCode.LengthRequired:
                    MessageBox.Show(Labels.ConnectionErrorMessage, Labels.ConnectionErrorTitle, MessageBoxButton.OK);
                    return;
                case HttpStatusCode.BadRequest:
                    MessageBox.Show(Labels.FileExtensionError, Labels.ErrorTitle, MessageBoxButton.OK);
                    return;
            }

            MessageBox.Show(Labels.GenericErrorMessage, Labels.ErrorTitle, MessageBoxButton.OK);
        }
コード例 #7
0
        void Fail(DropboxException ed)
        {
            Utilities.ShowProgressIndicator(false);
            switch ((int)ed.StatusCode)
            {
                case (int)HttpStatusCode.NotFound:
                    MessageBox.Show(Labels.ConnectionErrorMessage, Labels.ConnectionErrorTitle, MessageBoxButton.OK);
                    return;

                case (int)HttpStatusCode.Forbidden:
                    MessageBox.Show(Labels.FolderExist, Labels.ErrorTitle, MessageBoxButton.OK);
                    return;

                case 507:
                    MessageBox.Show(Labels.NoSpaceAvailable, Labels.ErrorTitle, MessageBoxButton.OK);
                    return;
            }

            MessageBox.Show(ed.StatusCode.ToString());
        }
コード例 #8
0
ファイル: List.xaml.cs プロジェクト: MiffyLiye/codesafe
 private void OnListFailed(DropboxException ex)
 {
     Dispatcher.BeginInvoke(() =>
         MessageBox.Show(
             DropBoxResources.ListError,
             DropBoxResources.ListTitle,
             MessageBoxButton.OK));
 }
コード例 #9
0
 void OnShareFailed(DropboxException ex)
 {
     Utilities.ShowProgressIndicator(false);
     switch (ex.StatusCode)
     {
         case HttpStatusCode.Forbidden:
             MessageBox.Show(Labels.ShareFileError, Labels.ErrorTitle, MessageBoxButton.OK);
             break;
         case HttpStatusCode.NotFound:
             MessageBox.Show(Labels.FileNotFoundShare, Labels.ErrorTitle, MessageBoxButton.OK);
             break;
         case HttpStatusCode.NotAcceptable:
             MessageBox.Show(Labels.ServerError, Labels.ErrorTitle, MessageBoxButton.OK);
             break;
         default:
             MessageBox.Show(ex.StatusCode.ToString());
             break;
     }
 }
コード例 #10
0
 private void OnLoginError(DropboxException error)
 {
     this.DialogViewService.MessageBoxOkInUIThead(NewDownload.Error, NewDownload.DropboxLoginFailed);
     this.Logout();
 }
コード例 #11
0
ファイル: DropBoxClient.cs プロジェクト: runegri/CrossBox
        public void GetFolderContent(string folder, Action<IEnumerable<DropBoxItem>> onSuccess, Action<Exception> onError)
        {
            if (!IsAuthenticated)
            {
                var exception = new DropboxException("Not authenticated");
                onError(exception);
                return;
            }

            Client.GetMetaDataAsync(folder,
                                     metaData =>
                                     {
                                         var contents = metaData
                                             .Contents
                                             .Select(DropBoxItem.FromMetaData)
                                             .ToList();

                                         onSuccess(contents);
                                     },
                                     dropBoxException => onError(dropBoxException));
        }
コード例 #12
0
        void OnDownloadFailed(DropboxException ex)
        {
            Utilities.ShowProgressIndicator(false);

            switch (ex.StatusCode)
            {
                case HttpStatusCode.NotFound:
                    MessageBox.Show(Labels.FileNotFoundShare, Labels.ErrorTitle, MessageBoxButton.OK);
                    break;
                default:
                    MessageBox.Show(ex.StatusCode.ToString());
                    break;
            }
        }
コード例 #13
0
 protected void Fail(DropboxException ed)
 {
     IsLoading = false;
     Deployment.Current.Dispatcher.BeginInvoke(() => Utilities.ShowProgressIndicator(false));
     MessageBox.Show(Labels.GenericErrorMessage, Labels.ErrorTitle, MessageBoxButton.OK);
 }
コード例 #14
0
ファイル: FileAsyncTests.cs プロジェクト: popopome/memocloud
 private void Can_Upload_Large_File_Async_Failure(DropboxException error)
 {
     Assert.IsTrue(false);
 }
コード例 #15
0
ファイル: DropboxSync.cs プロジェクト: popopome/memocloud
    /// <summary>
    /// Folder meta data could not found.
    /// </summary>
    void OnFirstSyncMetaDataError(DropboxException err)
    {
      //
      // Remote site has no such an folder.
      // This is expected response from server.
      //
      // Let's create dropbox folder and
      // start to sync between REMOTE and LOCAL.
      //
      if (err.StatusCode == HttpStatusCode.NotFound)
      {
        Log("No folder on remote side. Let's create new folder:{0}",
            _ws.Name);
        ThreadUtil.Execute(CreateDropboxFolder);
        return;
      }

      FireFinishedEvent(DropboxSyncResult.UnknownError,
                        err.Response.ErrorMessage);
    }
コード例 #16
0
ファイル: FileAsyncTests.cs プロジェクト: popopome/memocloud
 private void Can_Get_Thumbnail_Async_Failure(DropboxException error)
 {
     Assert.IsTrue(false);
 }
コード例 #17
0
ファイル: DropboxSync.cs プロジェクト: popopome/memocloud
    /// <summary>
    /// Error message
    /// </summary>
    /// <param name="err">Dropbox exception</param>
    /// <returns>Error message from exception object</returns>
    string ErrorMessage(DropboxException err)
    {
      if (err == null
        || err.Response == null)
        return "Unknown error";

      return err.Response.Content;
    }
コード例 #18
0
 private void OnFail(DropboxException ex)
 {
     MessageBox.Show(Labels.UserInfoError, Labels.ErrorTitle, MessageBoxButton.OK);
 }
コード例 #19
0
        private void Fail(DropboxException ex)
        {
            Found = false;
            IsLoading = false;

            if (ex.StatusCode == HttpStatusCode.NotFound)
            {
                MessageBox.Show(Labels.ConnectionErrorMessage, Labels.ConnectionErrorTitle, MessageBoxButton.OK);
            }

            MessageBox.Show(Labels.GenericErrorMessage, Labels.ErrorTitle, MessageBoxButton.OK);
        }
コード例 #20
0
 private void OnMetaDaError(DropboxException error)
 {
     this.DialogViewService.MessageBoxOkInUIThead(NewDownload.Error, NewDownload.BrowseFolderFailedLabel);
     this.Logout();
 }
コード例 #21
0
 private void OnChunkedUploadFailure(DropboxException dropboxException)
 {
     _chunksFailed++;
     if (_lastChunkUploaded != null && _chunksFailed <= _maxRetries.GetValueOrDefault(DefaultMaxRetries))
     {
         OnChunkSuccess(_lastChunkUploaded);
     }
     else
     {
         _failure.Invoke(dropboxException);
     }
 }