ctype error handler