Refactoring to support conneg in OnError pipeline