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

Configurable behaviour for user exceptions #80

Open
ayaankazerouni opened this issue Oct 3, 2017 · 8 comments
Open

Configurable behaviour for user exceptions #80

ayaankazerouni opened this issue Oct 3, 2017 · 8 comments

Comments

@ayaankazerouni
Copy link
Contributor

If there's an error in my code, it'd be nice if I could see Exceptions and stack traces and the like. Currently it seems like RepoDriller masks all of this.

@mauricioaniche
Copy link
Owner

(Related to #78)

@ayaankazerouni You are right. Up to now, repodriller basically logs your exception and moves on. Just to get more context, what would you want to do with the exception? And why would an exception 'escape' from your study class?

For now, my thoughts were: your study should catch any exceptions that it may throw. If, for some reason, an exception escaped, there's nothing much you can do; we log and move on.

@ayaankazerouni
Copy link
Contributor Author

ayaankazerouni commented Oct 4, 2017

I was thinking more about unintended Exceptions whose error messages are useful for debugging issues. Right now, the study just ends if something is wrong. I'm using APIs that I'm not really familiar with (Eclipse JDT, RepoDriller itself), so that stuff would be helpful. More dangerous, if I get output that looks correct, I have no idea if an Exception ended the study early.

If, for some reason, an exception escaped, there's nothing much you can do;

Yes, but I would think the client should decide what to do in this situation, right?

log and move on

Do you mean log4j? I haven't been able to get that working, but that's my lack of expertise and a separate issue :)

@mauricioaniche
Copy link
Owner

Does it stop? It shouldn't! When an error occurs (let's suppose you forgot to get an exception) and it pops up to repodriller, the framework catches it, and logs the error using log4j!

If you don't see log4j logs on your console, then you are not configuring it! Create the log4.xml in your src/main/resources folder. An example can be found here: https://github.com/mauricioaniche/repodriller/blob/master/src/main/resources/log4j.xml.example

Then, let me know if the log is enough. And if repodriller is really crashing due to an exception, I wanna see your source code. If you are at TU Delft next week, we can meet!

@ayaankazerouni
Copy link
Contributor Author

ayaankazerouni commented Oct 4, 2017

Ok, I had my log4j.xml in the project root. I've moved it to src/main/resources/, and things seem to be logging now. I now see some exceptions messages. Thanks for the help!

I would still consider configurable exception behaviours, though.

EDIT: It's a long trek from the US to the Netherlands, so I probably won't be at TU Delft next week :)

@mauricioaniche
Copy link
Owner

Oh, sorry, @ayaankazerouni! I thought you were one of our current students!! :)

I'll keep this issue open so that we re-visit it soon! Meanwhile, if you wanna contribute with a PR that actually makes this log configuration more explicit, I guess that'd be very helpful!!

@ayaankazerouni
Copy link
Contributor Author

ayaankazerouni commented Mar 7, 2018

This seems to have resurfaced in a different way. I've gotten log4j2 configured and working since I first opened this issue. But it's no longer logging any Exceptions that my code throws, which is making debugging kind of difficult. Perhaps one of the recent updates did something?

EDIT: Maybe 'resurfaced' is not the right word...

cc: @davisjam

@mauricioaniche
Copy link
Owner

Are you sure it's not something wrong in your code? Logs are working on our CI: https://travis-ci.org/mauricioaniche/repodriller

@ayaankazerouni
Copy link
Contributor Author

Ok, you know what? I think it was an overly-broad catch clause in my own code. Ignore these messages!

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

2 participants