make all TLS functions call the user-provided error handler