catch exception when workspace is undefined, fix return code in case of errors