Fix PASSING when a failure occurs.

Closed David Mondou requested to merge fix/exit-on-failure into master

Removed here document. Added extra checking for failure

Merge request reports