which exception method is used for error of strings. and how to know which exception method is better