Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
# Let's call our custom error "StupidError"; it inherits from the Exception class
|
||||
|
||||
class StupidError(Exception): pass
|
||||
|
||||
# Try it out.
|
||||
try:
|
||||
raise StupidError("Segfault") # here, we manually 'raise' the error within the try block
|
||||
except StupidError, details: # 'details' is the StupidError object we create in the try block.
|
||||
print 'Something stupid occurred:', details # so we access the value we had stored for it...
|
||||
|
||||
|
||||
# Output :
|
||||
# Something stupid occurred: Segfault
|
||||
Loading…
Add table
Add a link
Reference in a new issue