some basic handling of sql exceptions