Not able to capture error while using dialog

I am not able to capture errors while I am using dialog. For example:

dialog --gauge "Verifying file..." 10 75 < <(

while read LINE
do 
	hash=$(echo $LINE | cut -f1 -d' ')
	directory=$(echo $LINE | cut -c 34-)
 	PCT=$(( 100*(++i)/n ))

	echo $PCT

	md5deep -a $hash $directory > /dev/null
	RESULT=$?
	if [ $RESULT -ne 0 ]
	then
		dialog_hash_failed	
		error "Failed"
	fi

       

done < $TAR_SO/$SOURCEFILE_NAME.md5 
)||exit 1

However, if I get rid of the dialog command, I am able to capture all errors in the md5 verification. While using dialog, the code exits successfully but the return value is always a zero. I am expecting a non zero return value and I am able to achieve it while not using dialog

Using dialog, the return value is the the one of dialog itself ( success! as you say... so 0...) not from the while...

So there is no way I could trap the error from the while loop?

Maybe using co process (using shell that supports e.g. ksh...) but I have no knowldge of dialog... Is there nothing in the man pages? ( sorry no linux around today... only aix, solaris, hp-ux...)