Ignore:
Timestamp:
Sep 19, 2011, 1:31:35 PM (13 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Children:
c104b43
Parents:
cfca761
git-author:
Edward Z. Yang <ezyang@mit.edu> (07/12/11 09:17:04)
git-committer:
Edward Z. Yang <ezyang@mit.edu> (09/19/11 13:31:35)
Message:
Convert to async (both Facebook::Graph and us.)

Work items:
    - Documentation is all out of date
    - Think more carefully about error handling
      (right now it's delayed into the response object)
    - Really bad HTTP POST hack in Publish.pm.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Facebook/lib/Facebook/Graph/AccessToken/Response.pm

    rcfca761 r9820d55  
    1818    lazy    => 1,
    1919    default => sub {
     20        # LOL error handling
    2021        my $self = shift;
    21         my $response = $self->response;
    22         if ($response->is_success) {
    23             return URI->new('?'.$response->content)->query_param('access_token');
    24         }
    25         else {
    26             ouch $response->code, 'Could not fetch access token: '.$response->message, $response->request->uri->as_string;
    27         }
     22        return URI->new('?'.$self->response)->query_param('access_token');
     23        #else {
     24        #    ouch $response->code, 'Could not fetch access token: '.$response->message, $response->request->uri->as_string;
     25        #}
    2826    }
    2927);
     
    3331    lazy    => 1,
    3432    default => sub {
     33        # LOL error handling
    3534        my $self = shift;
    36         my $response = $self->response;
    37         if ($response->is_success) {
    38             return URI->new('?'.$response->content)->query_param('expires');
    39         }
    40         else {
    41             ouch $response->code, 'Could not fetch access token: '.$response->message, $response->request->uri->as_string;
    42         }
     35        return URI->new('?'.$self->response)->query_param('expires');
     36        #else {
     37        #    ouch $response->code, 'Could not fetch access token: '.$response->message, $response->request->uri->as_string;
     38        #}
    4339    }
    4440);
Note: See TracChangeset for help on using the changeset viewer.