What error? Don't know, this can often be something totally unexpected. The error handler can be set up to give you an error code but won't really tell you exactly what is causing the error. Error handler is supposed to deal with any possible error and prevent the program from a crash that locks the program and user can't exit or even freezes the entire computer. Do you really need error handler? Depends on your program.
You want to save the count of records - why? This is a dynamic value and can be calculated whenever needed. But if you must, yes, create a new field in the table and then in event populate it with the expression.