javascript throw error without try catch