Skip to content

Commit

Permalink
Clarity of error messaging (#35)
Browse files Browse the repository at this point in the history
* Add more clarity to error messages when the destination doesn't exist

* bump version
  • Loading branch information
algrs authored Mar 27, 2017
1 parent 3ae7753 commit 8f72729
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion baiji/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,15 @@ def execute(self):
else:
raise InvalidSchemeException("Copy for URI Scheme %s to %s is not implemented" % self.task)
except KeyNotFound:
raise KeyNotFound("Error copying {} to {}: Source doesn't exist".format(self.src.uri, self.dst.uri))
if self.dst.is_s3:
try:
_ = self.dst.bucket
except KeyNotFound:
raise KeyNotFound("Error copying {} to {}: Destination bucket doesn't exist".format(self.src.uri, self.dst.uri))
if not self.src.exists():
raise KeyNotFound("Error copying {} to {}: Source doesn't exist".format(self.src.uri, self.dst.uri))
else:
raise KeyNotFound("Error copying {} to {}: Destination doesn't exist".format(self.src.uri, self.dst.uri))
except IOError as e:
import errno
if e.errno == errno.ENOENT:
Expand Down
2 changes: 1 addition & 1 deletion baiji/package_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#
# See https://www.python.org/dev/peps/pep-0420/#namespace-packages-today

__version__ = '2.6.0'
__version__ = '2.6.1'

0 comments on commit 8f72729

Please sign in to comment.