Alternative to IndexOutOfRangeException

M

Magnus.Moraberg

Hi,

I have the following methods -

public MyClass this[int index]
public MyClass this[string myClassName]

if this[int index] recieves an index which is outside the bounds of
the concerned array, I throw - IndexOutOfRangeException

What exception should I throw if no object in the concerned array has
the name myClassName, for this[string myClassName]?

Thanks,

Barry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top