Handle regex exceptions correctly

Certain situations where a 400 was thrown and no error was
expected could cause the test to assert true due to bad
handling of the regex pattern.

Also add a bunch of printed debug info to make looking
at test output easier.