added more logging when an error is passed to next, specifically useful for debugging csrf stuff