Skip to content

except Exception in progress coding hiding bugs #435

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

Closed
barry-scott opened this issue May 20, 2016 · 1 comment
Closed

except Exception in progress coding hiding bugs #435

barry-scott opened this issue May 20, 2016 · 1 comment
Assignees

Comments

@barry-scott
Copy link
Contributor

barry-scott commented May 20, 2016

I have just spent an hour debugging my first progress code for clone_from.

I had a silly bug in my code, but because of this:

       try:
            handler(line)
        except Exception:

I did not see any errors.

This code is in _dispatch_single_line or func handle_process_output in cmd.py

I do not see why you have this try handler at all.
Given that I have no logger file setup in my code that this experiment was conducted in
the logged error is silent.

I recommend that you remove the try/except altogether.

If you have a good reason to keep the try/except then use
log.exception( 'msg' )
that will include the traceback details.

@Byron Byron self-assigned this May 24, 2016
@Byron
Copy link
Member

Byron commented May 24, 2016

I totally agree that catching all exceptions is bad practice, and am sorry to hear you spend so much time to trace that down.

The code I see in the latest version (please note it's always a good idea to state which version you are using ;)) is logging the exception accordingly.

Maybe the intention of this was to assure the line handler will never interrupt an ongoing fetch or pull. Changing this now would be a breaking change for buggy handler code ... but probably it's nothing to worry about anyway.

Thinking about it this way, I believe it's a good thing to change it.

@Byron Byron added this to the v2.0.3 - Bugfixes milestone May 24, 2016
@Byron Byron closed this as completed in 7a8f96c May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants