Skip to content

Commit

Permalink
Improve error messages and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
musically-ut committed Apr 21, 2015
1 parent 4120734 commit 41d183f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions seqfile/seqfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def _getStrBetween(prefix, s, suffix):
return s[preIdx + len(prefix):sufIdx]

def _doAtomicFileCreation(filePath):
"""Atomically tries to create the file."""
"""Tries to atomically create the requested file."""
try:
_os.close(_os.open(filePath, _os.O_CREAT | _os.O_EXCL))
return True
Expand All @@ -25,7 +25,7 @@ def _doAtomicFileCreation(filePath):

def _findNextFile(folder, prefix, suffix, fnameGen, base, maxattempts, loop):
if loop >= maxattempts:
raise OSError('Unable to create file after ' + str(maxattempts) + ' attempts.')
raise OSError("Unable to create file at " + folder + " after " + str(maxattempts) + " attempts.")

if prefix is None and fnameGen is None:
raise RuntimeError("Need at least one of prefix or fnameGen to proceed.")
Expand Down

0 comments on commit 41d183f

Please sign in to comment.