title: Uncaught OAuthException - how to catch this error?
body: <p>I have the below error.  How am I supposed to catch this error?</p>
  
  <blockquote>
    <p>Fatal error: Uncaught OAuthException: Error validating access token:
    User 638720122 has not authorized application 207445576002891. thrown
    in
    /var/www/clients/client1/web12/web/socialmediaping/fblibrary/base_facebook.php
    on line 1039</p>
  </blockquote>
  
  <p>I have the below snippet of code where I beleive I do attempt to manage the error.</p>
  
  <pre><code>// Attempt to query the graph:
  $graph_url = "https://graph.facebook.com/me?"
    . "access_token=" . $access_token;
  $response = curl_get_file_contents($graph_url);
  $decoded_response = json_decode($response);
  
  //Check for errors 
  if ($decoded_response-&gt;error) {
      $facebookAuth = FALSE;
  }  
  </code></pre>
  
  <p>Further down I redirect the user to facebook to authoise if $facebookAuth == FALSE but this isnt working, so What should I be doing?</p>
  
  <p>Many thanks in advance for your help.</p>