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

Unified Diff: tools/deep_memory_profiler/lib/exception.py

Issue 19346002: Refactor dmprof: Split dmprof.py into modules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: tools/deep_memory_profiler/lib/exception.py
diff --git a/tools/deep_memory_profiler/lib/exception.py b/tools/deep_memory_profiler/lib/exception.py
new file mode 100644
index 0000000000000000000000000000000000000000..6b564df94c7564e743a910a15b58e625eee4656a
--- /dev/null
+++ b/tools/deep_memory_profiler/lib/exception.py
@@ -0,0 +1,34 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
M-A Ruel 2013/07/16 13:31:32 Maybe name it exceptions.py ?
Dai Mikurube (NOT FULLTIME) 2013/07/17 05:55:06 Done.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class EmptyDumpException(Exception):
+ def __init__(self, value=''):
+ super(EmptyDumpException, self).__init__()
M-A Ruel 2013/07/16 13:31:32 Just FYI, you could go simpler with: class EmptyD
Dai Mikurube (NOT FULLTIME) 2013/07/17 05:55:06 Done.
+ self.value = value
+ def __str__(self):
+ return repr(self.value)
+
+
+class ParsingException(Exception):
+ def __init__(self, value=''):
+ super(ParsingException, self).__init__()
+ self.value = value
+ def __str__(self):
+ return repr(self.value)
+
+
+class InvalidDumpException(ParsingException):
+ def __init__(self, value):
+ super(InvalidDumpException, self).__init__()
+ self.value = value
+ def __str__(self):
+ return "invalid heap profile dump: %s" % repr(self.value)
+
+
+class ObsoleteDumpVersionException(ParsingException):
+ def __init__(self, value):
+ super(ObsoleteDumpVersionException, self).__init__()
+ self.value = value
+ def __str__(self):
+ return "obsolete heap profile dump version: %s" % repr(self.value)

Powered by Google App Engine
This is Rietveld 408576698