$HOME/tmp/test.gsh
throw new Exception("test")
|
Docker command
docker run -it \
|
--link grouper-dist-pgsql:db \
|
--mount type=bind,source=$HOME/tmp/test.gsh,target=/tmp/test.gsh \
|
--mount type=bind,source=$GPDU/classes,target=/opt/grouper/grouperWebapp/WEB-INF/classes \
|
i2incommon/grouper:2.6.5.3 gsh /tmp/test.gsh
|
output
...
|
groovy:000> :gshFileLoad '/tmp/test.gsh'
|
grouper;console;;;groovy:000> :gshFileLoad '/tmp/test.gsh'
|
FATAL: java.lang.IllegalArgumentException: Error when handling error: Error while running command (throw new Exception("test"))
|
java.lang.IllegalArgumentException: Error when handling error: Error while running command (throw new Exception("test"))
|
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
|
...
|
exit code
I believe the problem is that /usr/local/bin/gsh runs `bin/gsh.sh`, but then pipes it to a tee command, which will pretty much also return success. From my testing, setting `set -o pipefail` before this command can fix this, as it will return the last non-zero status (http://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Pipelines).
This may be a similar problem to GRP-2204, which was closed as a non-issue. However, the tee command may have been added since then.