throw error instead of string