Before/after should throw error if existing middleware cannot be found