Better error reporting for v2 plugins

@josephwb will you review/merge?