Throw a caught error in the default warning module

This throws an error that is immediately caught. This allows you to use the
debugger's "break on caught exception" feature to break on warnings.

This should help with tracking down these warnings using the stack.

However, it could also add more noise to other debugging pattern.
Merge pull request #2769 from sebmarkbage/breakonwarning

Throw a caught error in the default warning module