Throw a custom exception if a stream can not be identified.