PRO TEST_ERROR ; Error handling code. Catch, theError IF theError NE 0 THEN BEGIN Catch, /Cancel Help, /Last_Message, Output=theErrorMessage FOR j=0,N_Elements(theErrorMessage)-1 DO BEGIN Print, theErrorMessage[j] ENDFOR RETURN ENDIF ; The code that causes the error. Print, xxx END