C Error Handling using TRY/CATCH