I'd like to process user input and throw an Exception if it exceeds some fixed limit of character. Example:
public String read(Reader r){
String input;
//get the input
if(input.lenght() > 100)
//throw what?
return input;
}
Should I craft my own exception class for that case? I presume that just using IllegalArgumentException
would not be fine.