If you control the throwing of exceptions then you could try creating your own custom exception and then throwing it as well. Although why would you throw it if you already knew about the exception causing condition.
It usually doesn't make sense to throw and catch your own exceptions but in your special case you could attempt to do just that. So you would need to write your own exception class which encapsulates info about the container in question, throw it and then handle it.
However the container's state is questionable at the time of handling the exception.
Think about the following:
- Does it make sense to throw and catch your own exception?
- If you do not throw the exception then how would you get info about
the container?
- Why would you even want to access the container?
- Is the container on the stack or the heap?
- Who controls the lifetime of the container?
- Are you rethrowing the exception?