Right now, if something happens that prevents a destination object from saving (particularly SQL errors like integrity constraint violations), all we're able to save in the messages table for the most part is "New object was not saved, no error provided". We should set an error handler at the beginning of Migrate::import, which will call Migrate::saveMessage for notices and throw an exception for anything else.

Comments

mikeryan’s picture

Status: Active » Needs work

Well, the basic concept works, but the primary motivation here doesn't - db exceptions are caught and rerouted to the watchdog via a "logging callback". We can set such a callback, but because the callback is called as a variable function rather than via call_user_func(), we can't make the callback a class method, it needs to be a straight function. When I have a chance, I'll see if I can submit a core patch making logging callbacks proper PHP "callback" types, called via call_user_func().

mikeryan’s picture

mikeryan’s picture

Status: Needs work » Fixed

Long since fixed.

mikeryan’s picture

Assigned: Unassigned » mikeryan
Status: Fixed » Active
mikeryan’s picture

We can catch these in hook_watchdog(), which may be a more general way to pick up errors anyway, but it has to be able to figure out the Migration instance that resulted in the call. Perhaps scan all migrations for processing == TRUE?

mikeryan’s picture

Status: Active » Fixed

Final issue addressed by Migration::currentMigration().

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pengo’s picture

I'm still getting "New object was not saved, no error provided" on a file migration (migrate 7.x-2.5+32-dev). Struggling to debug.