Code outputs errors twice even though the request is stopped?
<p>I am having an issue. </p>

<p>When I get an error on this code it outputs the error twice even though the function I call kills the response, notice the OutputError:</p>

<pre><code>   private dynamic GetOauthTokens(string code)
        {
            Dictionary&lt;string, string&gt; tokens = new Dictionary&lt;string, string&gt;();

            string url = string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&amp;redirect_uri={1}&amp;client_secret={2}&amp;code={3}",
                myAppId, HttpUtility.UrlEncode(myLoginRedirectUrl), myAppSecret, code);

            try
            {
                HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;

                using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
                {
                    StreamReader reader = new StreamReader(response.GetResponseStream());
                    string retVal = reader.ReadToEnd();

                    foreach (string token in retVal.Split('&amp;'))
                    {
                        tokens.Add(token.Substring(0, token.IndexOf("=")),
                            token.Substring(token.IndexOf("=") + 1, token.Length - token.IndexOf("=") - 1));
                    }
                }
            }
            catch (Exception exception)
            {
                OutputError("Code", exception.Message);
            }

            return tokens;
        }
</code></pre>

<p>and here is where I handle it:</p>

<pre><code> protected void OutputError(string error, string message)
        {
            object obj = new { Status = false, Error = error, Message = message };
            string objJson = JsonConvert.SerializeObject(obj);

            myHttpContext.Response.Write("LinkedLook.getJson(" + objJson + ");");
            myHttpContext.Response.End();
        }
</code></pre>

<p>For some reason it spits it out twice... what am I doing wrong?</p>
