Ignore:
Timestamp:
Sep 20, 2011, 11:15:32 PM (10 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Branches:
master, release-1.9
Children:
b7fa912
Parents:
2a42248
git-author:
Edward Z. Yang <ezyang@mit.edu> (07/12/11 09:17:04)
git-committer:
Edward Z. Yang <ezyang@mit.edu> (09/20/11 23:15:32)
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

    r2a42248 r7777ac2  
    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.