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

closes #3665 - Show original exception in error messages. #266

Closed

Conversation

sf-dlund
Copy link

Updated init function to include Original Exception attribute as originalExc.

Updated individual error classes to display originalExc.

Updated convert_os_errors to pass exception type into init function for each error type.

Tested by raising various types of errors within local fs implementation.

Copy link
Member

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't think this adds much. I see what you are trying to do. But often the 'original exception' isn't helpful and even misleading. Better to store any exception object in the 'details' parameter.

@@ -49,30 +49,31 @@ class FSError(Exception):
"""Base exception class for the FS module."""
default_message = "Unspecified error"

def __init__(self,msg=None,details=None):
def __init__(self, msg=None, details=None, originalExc=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameters should be lower_case_and_underscores

@sf-dlund
Copy link
Author

Thanks for the response. I actually intended to push to a forked version
and forgot to change my source.

On Fri, Oct 14, 2016 at 11:29 AM, Will McGugan notifications@github.com
wrote:

@willmcgugan commented on this pull request.

Sorry, I don't think this adds much. I see what you are trying to do. But
often the 'original exception' isn't helpful and even misleading. Better to

store any exception object in the 'details' parameter.

In fs/errors.py
#266 (review)
:

@@ -49,30 +49,31 @@ class FSError(Exception):
"""Base exception class for the FS module."""
default_message = "Unspecified error"

  • def init(self,msg=None,details=None):
  • def init(self, msg=None, details=None, originalExc=None):

Parameters should be lower_case_and_underscores


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#266 (review),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVsXDSJ9WQslBKyKNuGGLuCzS-iWeroTks5qz5_DgaJpZM4KXHXF
.

David Lund
Developer
SmartFile
p: 877-336-3453 e: dlund@smartfile.com
a: 1025 N. Senate Ave. Indianapolis, IN 46202
https://facebook.com/smartfile https://twitter.com/smartfile
https://linkedin.com/company/smartfile

https://www.smartfile.com/email-cta

@sf-dlund sf-dlund closed this Nov 30, 2016
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

Successfully merging this pull request may close these issues.

2 participants