From: Mike Looijmans <mike.looijmans@topic.nl>
To: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>,
<openembedded-core@lists.openembedded.org>
Cc: paul.eggleton@linux.intel.com
Subject: Re: [PATCH] populate SDK: prepare calling of bb.utils for exceptions
Date: Fri, 16 Oct 2015 09:00:11 +0200 [thread overview]
Message-ID: <5620A07B.3050305@topic.nl> (raw)
In-Reply-To: <1444930021-4096-1-git-send-email-benjamin.esquivel@linux.intel.com>
On 15-10-15 19:27, Benjamin Esquivel wrote:
> bb.utils.remove, bb.utils.movefile and bb.utils.mkdirhier can throw
> exceptions that need handling and proper error messages.
>
> [YOCTO#8213]
...
> + def mkdirhier(self, dirpath):
> + try:
> + bb.utils.mkdirhier(dirpath)
> + except OSError as e:
> + bb.warn(str(e))
> + bb.error("cannot make dir for SDK: {}".format(dirpath))
...
I see two bad things happening here:
- This will print a message, but continue processing as if nothing bad
happened, wreaking havoc later on when the caller might expect the directory
to actually exist and raise exceptions that are much harder to solve.
- It loses the information in the original exception, and since it doesn't
throw a new exception, the user is now left in the dark as to where the
problem occured, since there's no stack trace now.
For what I see in this code, it will actually make thing worse by hiding
errors and obscuring information. You're not "handling" the exception here,
you're almost "ignoring" them, which isn't quite the same.
Kind regards,
Mike Looijmans
System Expert
TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com
Please consider the environment before printing this e-mail
next prev parent reply other threads:[~2015-10-16 8:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 17:27 [PATCH] populate SDK: prepare calling of bb.utils for exceptions Benjamin Esquivel
2015-10-16 2:15 ` Christopher Larson
2015-10-16 20:28 ` Benjamin Esquivel
2015-10-16 21:50 ` [PATCH V2] " Benjamin Esquivel
2015-10-19 5:27 ` Mike Looijmans
2015-10-19 15:28 ` [PATCH V3] " Benjamin Esquivel
2015-10-16 7:00 ` Mike Looijmans [this message]
2015-10-16 20:27 ` [PATCH] " Benjamin Esquivel
2015-10-16 10:01 ` Richard Purdie
2015-10-16 20:18 ` Benjamin Esquivel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5620A07B.3050305@topic.nl \
--to=mike.looijmans@topic.nl \
--cc=benjamin.esquivel@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox