Add error handling in sinatra test app to catch additional mysql query errors

- to help identify the occurrence of a commonly-seen CI flakiness condition