Standardize error outputs
xvlaurent opened this issue · 3 comments
Exit codes and error message are inconsistant for faulty PDB and cif files.
For example, processing an empty PDB file lead to no error (exit code 0) and a message printed in stderr while processing an empty CIF file lead to an error (exit code -11) and a no message in stderr.
Would it be possible to standardize errors exit codes and associate stderr messages?
peter@Peters-MacBook-Pro sample % ../../bin/fpocket -f test.cif
***** POCKET HUNTING BEGINS *****
pdbxplugin) cannot read file test.cif
pdbxplugin) error opening file.
zsh: segmentation fault ../../bin/fpocket -f test.cif
peter@Peters-MacBook-Pro sample % echo $?
139
peter@Peters-MacBook-Pro sample % ../../bin/fpocket -f test.pdb
***** POCKET HUNTING BEGINS *****
! File 'test.pdb' contains no atoms...
! File 'test.pdb' contains no atoms...
! PDB reading failed!
***** POCKET HUNTING ENDS *****
peter@Peters-MacBook-Pro sample % echo $?
0
integrated behaviour now:
peter@Peters-MacBook-Pro sample % ../../bin/fpocket -f test.pdb
***** POCKET HUNTING BEGINS *****
! File 'test.pdb' contains no atoms...
! File 'test.pdb' contains no atoms...
! Structure reading failed!
peter@Peters-MacBook-Pro sample % echo $?
1
peter@Peters-MacBook-Pro sample % ../../bin/fpocket -f test.cif
***** POCKET HUNTING BEGINS *****
pdbxplugin) cannot read file test.cif
pdbxplugin) error opening file.
! Structure reading failed or file is empty!
peter@Peters-MacBook-Pro sample % echo $?
1
peter@Peters-MacBook-Pro sample % ../../bin/fpocket -f 1UYD.pdb
***** POCKET HUNTING BEGINS *****
mkdir: 1UYD_out/pockets: File exists
***** POCKET HUNTING ENDS *****
peter@Peters-MacBook-Pro sample % echo $?
0
closing, fixed with : #125