madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22380: LJSUP-12807: Repost creating returns err...

Committer: sbelyaev
LJSUP-12807: Repost creating returns error about entry creating from now
U   trunk/cgi-bin/LJ/Entry/Repost.pm
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-07-03 13:14:43 UTC (rev 22379)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-07-03 14:06:11 UTC (rev 22380)
@@ -141,27 +141,12 @@
     my $res = LJ::Protocol::do_request("postevent", \%req, \$err, $flags);
 
     $flags->{u} = undef;
-    my $fail = !defined $res->{itemid} && $res->{message};
-    if ($fail) {
-         warn "repost_create: 1, request " . LJ::compact_dumper(%req);
-              " flags: " . LJ::compact_dumper($flags) .
-              " result: " . LJ::compact_dumper($res) .
-              " error: $err" if $err;
-
-         $$error = LJ::API::Error->make_error( $res->{message},($err || -10000) );
+    if ($err) {
+         my ($code, $text) = split(/:/, $err);
+         $$error = LJ::API::Error->make_error( $text, -$code );
          return;
     }
 
-    if ($err) {    
-        warn "repost_create: 2, request " . LJ::compact_dumper(%req) .
-            " flags: " . LJ::compact_dumper($flags) .
-            " result: " . LJ::compact_dumper($res) .
-            " error: $err";
-
-        $$error = LJ::API::Error->get_error('create_entry_failed');
-        return;
-    }
-
     return LJ::Entry->new($u, jitemid => $res->{'itemid'} );
 }
 

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments