custom oauth flow exception handling as a plugin