Never return something else on error. Just throw an exception (or let the original exception through). A function should always return the same type of data.