Wolfram Technology Guide: Instant High-Level Debugging  previous | next 
Break When Messages Are Generated
Mathematica allows you to run a program, breaking whenever a message is generated.
Out[1]=