error handler, initial client-side lib code