merge: any non-zero return from the user is an error

This fixes #1703.