Use appropriate function to return error