Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:58:58+00:00 2026-05-27T15:58:58+00:00

Beginner question perhaps: I’m trying to check my user permissions from facebook with Koala.

  • 0

Beginner question perhaps:

I’m trying to check my user permissions from facebook with Koala. In some cases I’m going to get thrown an error. So I just want to catch it and redirect to re-authenticate.

  def check_facebook_permissions
    if token = current_user.try(:authentications).find_by_provider('facebook').try(:token)
      graph = Koala::Facebook::API.new(token)
      permissions = graph.get_connections('me','permissions')
      session[:facebook] = {}
      session[:facebook][:ask_publish_actions] = true if permissions[0]['publish_actions'] != true && permissions[0]['publish_stream'] != true
    end
  rescue_from Koala::Facebook::APIError
    # Do something funky here
  end

I thought this was straightforward, but I’m never hitting my rescue. Instead I get:

Koala::Facebook::APIError (OAuthException: Error validating access token: Session has expired at unix time 1324026000. The current unix time is 1324352685.):

What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:58:59+00:00Added an answer on May 27, 2026 at 3:58 pm

    rescue_from is not a syntactic construct of Ruby like rescue is – it is a normal function, and you need a block to go with it. In your code, no code is given, rescue_from gets executed and effectively skipped – what is after it has no bearing on any exceptions raised before it (just as if you put any other function, like puts, instead of rescue_from).

    See an example of rescue_from use here.

    To make this code work, you need the vanilla Ruby rescue:

    rescue Koala::Facebook::APIError => e
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL Server Beginner question: I'm trying to introduce a computed column in SQL Server
Beginner question here. I'm going to make a Jquery function that is used to
This is an absolute beginner question in TFS SDK: I am trying to connect
I'm sure this is a completely obvious beginner question, but trying to find answers
Beginner question... How different is define($a,365); from $a = 365; ? Thanks! JDelage
very beginner question. I am using Rails 3's query interface as shown: class User
This is a beginner question, I have to create some SQL Reports with business
Beginner question: I want to debug some code that compiles. I pressed debug, it
I know this is a srs beginner question, but here goes: I am trying
It's probably beginner question but I'm going through documentation for longer time already and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.