easybuilders / easybuild-framework

EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way.
https://easybuild.io
GNU General Public License v2.0
152 stars 202 forks source link

provide more user-friendly error messages #139

Open boegel opened 12 years ago

boegel commented 12 years ago

(old internal ticket 328)

For example:

EasyBuildError: "EasyBuild crashed with an error (at easybuild/easybuild/tools/filetools.py:146 in extractCmd): Unknown
file type from file /home/clusterusers/claczny/easybuild_sources/b/bowtie2/bowtie2-2.0.0-beta7-linux-x86_64.zip/download

This is not an EasyBuild crash, but should be an error to inform the user that something is wrong with his easyconfig file.

Tell him the supported filetypes. And to use a tuple to describe the download url if there are suffixes behind the name-version.tgz part.

boegel commented 11 years ago

Another example, provided by @berndmohr

== fetching files...
ERROR: EasyBuild encountered an exception (at easybuild/lib/python2.7/site-packages/easybuild_framework-1.9.0dev-py2.7.egg/easybuild/main.py:843
in build_and_install_software): autoBuild Failed (last 300 chars):
hon2.7/site-packages/easybuild_easyconfigs-1.9.0.0dev-py2.7.egg/easybuild/easyconfigs/extrae-2.4.1.tar.bz2,
/private/opt/local/easybuild/sources/e/Extrae/extrae-2.4.1.tar.bz2,
/private/opt/local/easybuild/sources/Extrae/extrae-2.4.1.tar.bz2,
/private/opt/local/easybuild/sources/extrae-2.4.1.tar.bz2

should be

ERROR: Cannot find required software (extrae-2.4.1.tar.bz2).
1. Please go to
  http://www.bsc.es/computer-sciences/performance-tools/downloads
  and follow instructions to download the package.
2. Place file into one of the following locations:
  - /private/opt/local/easybuild/sources/e/Extrae/extrae-2.4.1.tar.bz2,
  - /private/opt/local/easybuild/sources/Extrae/extrae-2.4.1.tar.bz2,
  - /private/opt/local/easybuild/sources/extrae-2.4.1.tar.bz2
boegel commented 10 years ago

I've been thinking on how to tackle this, and I think we need a dedicated error_reporting module which provides pretty printing functionality for errors. This module could provide functions like fatal_error(msg, err), report_missing_deps(deps), etc. Trying to pretty print things all over the place will be too messy, we need a more centralised approach.