fix throw error to try-catch.