throw a RuntimeException if the db function fails