Is there a way to perform error checking with $db->query?

When using the global database manager, is there a way to catch errors? Just in case.

Ideally I would like to check for errors here before sending success.

Thanks!