Constructs an instance from the given input string, reason, and error index.
|the input string|
|a string explaining why the input was rejected|
|the index at which the error occurred, or -1 if the index is not known|
|if either the input or reason strings are null|
|if the error index is less than -1|