Better error handling

Creates a custom error if we detect not enough information to perform migration.

Also, don't override error if we already set it.