Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise User-defined Exceptions issue #3

Open
QinghuaLong opened this issue Jul 18, 2019 · 0 comments
Open

Raise User-defined Exceptions issue #3

QinghuaLong opened this issue Jul 18, 2019 · 0 comments

Comments

@QinghuaLong
Copy link

QinghuaLong commented Jul 18, 2019

When trying to raise a user-defined exception the exception is not get inited correctly. Instead of the Exeption class it catch a tupple in the user defined handler instead. Could run the test like below to see if it works:

def test_exception():
with self.assertRaises(RseException) as context:
raise (RseException("test",700)
self.assertTrue(type(context.exception) is RseException)
self.assertEquals(context.exception.message, "test")
self.assertEquals(context.exception.code, 700)

@QinghuaLong QinghuaLong self-assigned this Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant