OLD | NEW |
---|---|
(Empty) | |
1 # 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.
| |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 class EmptyDumpException(Exception): | |
6 def __init__(self, value=''): | |
7 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.
| |
8 self.value = value | |
9 def __str__(self): | |
10 return repr(self.value) | |
11 | |
12 | |
13 class ParsingException(Exception): | |
14 def __init__(self, value=''): | |
15 super(ParsingException, self).__init__() | |
16 self.value = value | |
17 def __str__(self): | |
18 return repr(self.value) | |
19 | |
20 | |
21 class InvalidDumpException(ParsingException): | |
22 def __init__(self, value): | |
23 super(InvalidDumpException, self).__init__() | |
24 self.value = value | |
25 def __str__(self): | |
26 return "invalid heap profile dump: %s" % repr(self.value) | |
27 | |
28 | |
29 class ObsoleteDumpVersionException(ParsingException): | |
30 def __init__(self, value): | |
31 super(ObsoleteDumpVersionException, self).__init__() | |
32 self.value = value | |
33 def __str__(self): | |
34 return "obsolete heap profile dump version: %s" % repr(self.value) | |
OLD | NEW |