There are few points that you need to take care.
# BadObjectException belongs to Non-Runtime exception category hence
if the called method throws this exception then the calling method
should either catch the exception and handle the same OR re-throw the
exception in its throws clause.
# BadIndexException belongs to Runtime Exception category hence the
programmer is not forced to catch it or re-throw it. It is his wish
to decide on how to handle that exception OR simply ignore it.
# In your program, doSometing() does NOT throw any exception (I am
stressing on Non-Runtime exception.. ) hence an attempt to catch
exception will cause the compile time error. The reason is,
BadObjectException is never thrown in the body of corresponding try
statement.
Hope it clarifies your doubt. Write me if you need more details.