standardize to modern 'except FooError as err:' syntax in test files

Step 1 of this standardization.