The 'out of band' implication that invalid URI means there is a square bracket in it is OK for now. In the future I would consider getting this information from the URI parser – the URI parser should return what is the reason for invalid URI.