Skip to content

derive EasyBuildError from LoggedException, deprecate log.error in favor of raise EasyBuildError#1218

Merged
boegel merged 17 commits intoeasybuilders:developfrom
boegel:raise_error
Mar 31, 2015
Merged

derive EasyBuildError from LoggedException, deprecate log.error in favor of raise EasyBuildError#1218
boegel merged 17 commits intoeasybuilders:developfrom
boegel:raise_error

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Mar 11, 2015

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 11, 2015

This is just a proof-of-concept, all other uses of log.error (and log.exception) still need to be replaced, but I didn't want to make the diff huge to start off with.

@stdweird, @JensTimmerman, @riccardomurri: thoughts?

Comment thread easybuild/tools/build_log.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not support EasyBuildError(msg, *args) ?

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1487/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 13, 2015

remarks fixed, pls rereview @stdweird?

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1498/
Test FAILed.

Comment thread easybuild/tools/build_log.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thsi method is deprected and add _ to indicate it's private

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1509/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 17, 2015

remarks fixed, please revisit before I tackle all remaining occurences of log.error into raise EasyBuildError

Comment thread easybuild/tools/build_log.py Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I may have to revisit this bit, since the tests treat all log.deprecated statements being hit as errors (by defining EASYBUILD_DEPRECATED to same ridiculously high version)

I don't think that'll work out well (since we'll be hitting this one all the time). Not sure where I can move this though for proper deprecation of _error_no_raise...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

After giving this some more thought, I don't think we should be using log.deprecated at all here...

The idea behind the log.deprecated is to indicate that deprecated functionality, i.e. stuff that will be removed in the future, is being triggered.

In this case _error_no_raise actually implement the behaviour that we want to be using, so it shouldn't trigger log.deprecated at all... Leaving it like this, we'll be triggering log.deprecated whenever an EasyBuildError is created.

I'll see if I can refurbish things to log.error being the behaviour we want (no raise), and move the bit currently in error that does the raise in a separate method that does contain log.deprecated.

I'm not sure that will fly though, since by default we actually want log.error to still raise, for now (to retain backward-compatibility).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

then simply add comment that indicates that method should never be used and that we are going to remove this in 3.0. no need to hack more around. it's already bad enough 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok, will do

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1510/
Test FAILed.

Comment thread easybuild/tools/build_log.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't print

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1515/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

and again...

Jenkins: test this please

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1567/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

Jenkins: test this please

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1568/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1569/
Test FAILed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1572/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

Jenkins: test this please

2 similar comments
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

Jenkins: test this please

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 27, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1577/
Test FAILed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1579/
Test FAILed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1580/
Test PASSed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1582/
Test PASSed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I need to change this using Fancylogger.error, otherwise errors are reporting in the logs like:

== 2015-03-31 13:34:58,605 main ERROR EasyBuild crashed with an error
(at easybuild/tools/build_log.py:136 in _error_no_raise):
Can't find path /Users/kehoste/work/easybuild-framework/foo.eb

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

while it used to be like:

ERROR: EasyBuild crashed with an error (at easybuild/framework/easyconfig/tools.py:317 in parse_easyconfigs):
Can't find path /Users/kehoste/work/easybuild-framework/foo.eb

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll handle this in a follow-up PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

see #1249

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 31, 2015

That's it, I'm merging in this beast. Progress!

Thanks for the review @stdweird!

boegel added a commit that referenced this pull request Mar 31, 2015
derive EasyBuildError from LoggedException, deprecate log.error in favor of raise EasyBuildError
@boegel boegel merged commit 93a6560 into easybuilders:develop Mar 31, 2015
@boegel boegel deleted the raise_error branch March 31, 2015 14:27
@boegel boegel mentioned this pull request Jun 24, 2015
@boegel boegel mentioned this pull request Jul 7, 2015
8 tasks
Flamefire added a commit to Flamefire/easybuild-framework that referenced this pull request Jan 14, 2026
Only used in one place and all error logging should happen in the
constructor of `EasyBuildError` since easybuilders#1218
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.

4 participants