Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Returning a summary message #16

Open
weavermedia opened this issue May 14, 2014 · 2 comments
Open

Returning a summary message #16

weavermedia opened this issue May 14, 2014 · 2 comments

Comments

@weavermedia
Copy link

During the import process I'm using the row_* callbacks to build a summary message for the user, something like:

156 row(s) processed.
154 row(s) successfully imported.
Error on row 25 - Validation failed: Email address has already been taken.
Error on row 89 - Validation failed: Email address has already been taken.

Is there any method implemented for passing this back to the caller of the importer class?

I tried result = UserImporter.import('/path/to/file.xls') to see what I got back but it was just a Range.

@gnapse
Copy link
Contributor

gnapse commented May 14, 2014

I'll look into it.

@weavermedia
Copy link
Author

This references #18.

What I'd really like is some consistency with what is returned.

Depending on how the import process goes, by default, the result of the .import call can be:

  • it returns a range (if the whole process is a success)
  • it returns an exception (if there is something like a UTF-8 read-error)
  • it throws an app-wide fatal exception (if the column headers are incorrect)

It might be good to get something useful and consistent returned back from the method call.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants