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

Side by Side Diff: third_party/gsutil/20110627/gslib/exception.py

Issue 10199002: Upgrade gsutil to 3.4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 8 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright 2010 Google Inc.
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions:
10 #
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 """gsutil exceptions."""
23
24
25 class CommandException(StandardError):
26 """Exception raised when a problem is encountered running a gsutil command.
27
28 This exception should be used to signal user errors or system failures
29 (like timeouts), not bugs (like an incorrect param value). For the
30 latter you should raise Exception so we can see where/how it happened
31 via gsutil -D (which will include a stack trace for raised Exceptions).
32 """
33
34 def __init__(self, reason, informational=False):
35 """Instantiate a CommandException.
36
37 Args:
38 reason: text describing the problem.
39 informational: indicates reason should be printed as FYI, not a failure.
40 """
41 StandardError.__init__(self)
42 self.reason = reason
43 self.informational = informational
44
45 def __repr__(self):
46 return 'CommandException: %s' % self.reason
47
48 def __str__(self):
49 return 'CommandException: %s' % self.reason
50
51
52 class ProjectIdException(StandardError):
53
54 def __init__(self, reason):
55 StandardError.__init__(self)
56 self.reason = reason
57
58 def __repr__(self):
59 return 'ProjectIdException: %s' % self.reason
60
61 def __str__(self):
62 return 'ProjectIdException: %s' % self.reason
OLDNEW
« no previous file with comments | « third_party/gsutil/20110627/gslib/command.py ('k') | third_party/gsutil/20110627/gslib/project_id.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698