~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/action.py

  • Committer: wagrant
  • Date: 2008-07-10 02:33:16 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:841
filservice_lib now catches IOErrors (not just OSErrors) when uploading
files. It will transmit an appropriate error message to the client.

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
        dest = open(path, 'wb')
354
354
        if data is not None:
355
355
            shutil.copyfileobj(data, dest)
356
 
    except OSError:
357
 
        raise ActionError("Could not write to target file")
 
356
    except (IOError, OSError), e:
 
357
        raise ActionError("Could not write to target file: %s" % e.strerror)
358
358
 
359
359
def action_putfiles(req, fields):
360
360
    """Writes data to one or more files in a directory, overwriting them if