I think I would rather have this fail explicitly than silently not import an item a user has selected. Do you have examples where this might happen?

Also, processDocuments passes back two arguments: doc and url. Use the passed url rather than doc.location.