Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: gslib/exception.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gslib/daisy_chain_wrapper.py ('k') | gslib/file_part.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gslib/exception.py
===================================================================
--- gslib/exception.py (revision 33376)
+++ gslib/exception.py (working copy)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,13 +19,14 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-
"""gsutil exceptions.
The exceptions in this module are for use across multiple different classes.
"""
+from __future__ import absolute_import
+
class AbortException(StandardError):
"""Exception raised when a user aborts a command that needs to do cleanup."""
@@ -60,20 +62,21 @@
self.informational = informational
def __repr__(self):
- return 'CommandException: %s' % self.reason
+ return str(self)
def __str__(self):
return 'CommandException: %s' % self.reason
-class ProjectIdException(StandardError):
+class InvalidUrlError(Exception):
+ """Exception raised when URL is invalid."""
- def __init__(self, reason):
- StandardError.__init__(self)
- self.reason = reason
+ def __init__(self, message):
+ Exception.__init__(self, message)
+ self.message = message
def __repr__(self):
- return 'ProjectIdException: %s' % self.reason
+ return str(self)
def __str__(self):
- return 'ProjectIdException: %s' % self.reason
+ return 'InvalidUrlError: %s' % self.message
« no previous file with comments | « gslib/daisy_chain_wrapper.py ('k') | gslib/file_part.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698