Changeset 1530


Ignore:
Timestamp:
May 29, 2010, 4:31:34 PM (12 years ago)
Author:
Paul Lelgemann
Message:

+ P2PEditor: Exception handling, if workspace data cannot be retrieved using P2P

Location:
trunk/CrypPlugins/P2PEditor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/Distributed/DistributedJob.cs

    r1527 r1530  
    9191            }
    9292
     93            if (rawWorkspaceData == null || rawWorkspaceData.Length == 0)
     94            {
     95                throw new ArgumentOutOfRangeException(LocalFilePath, "Workspace could not be fetching using Peer-to-peer.");
     96            }
     97
    9398            File.WriteAllBytes(LocalFilePath, rawWorkspaceData);
    9499        }
  • trunk/CrypPlugins/P2PEditor/Distributed/JobListManager.cs

    r1527 r1530  
    1 using System.Collections.Generic;
     1using System;
     2using System.Collections.Generic;
    23using System.IO;
    34using System.Runtime.Serialization.Formatters.Binary;
  • trunk/CrypPlugins/P2PEditor/Worker/JobParticipationWorker.cs

    r1527 r1530  
    2626        private void JobParticipationWorker_DoWork(object sender, DoWorkEventArgs e)
    2727        {
    28             _jobListManager.CompleteDistributedJob(_jobToParticipateIn);
     28            try
     29            {
     30                _jobListManager.CompleteDistributedJob(_jobToParticipateIn);
     31            } catch(ArgumentOutOfRangeException ex)
     32            {
     33                _p2PEditor.GuiLogMessage("Error completing job: " + ex.Message, NotificationLevel.Error);
     34                return;
     35            }
    2936
    3037            _p2PEditor.GuiLogMessage("Local workspace: " + _jobToParticipateIn.LocalFilePath, NotificationLevel.Debug);
Note: See TracChangeset for help on using the changeset viewer.