what exceptions are raised by this method? Please define in docstring.