GitHub PullRequestReviewCommentEvent at 2014-05-01 23:32:23
Repository: gcm-erlang
Actor: jaynel
Payload: {"comment":{"url":"https://api.github.com/repos/tigertext/gcm-erlang/pulls/comments/12213384","id":12213384,"diff_hunk":"@@ -161,18 +164,23 @@ handle_error(<<\"InternalServerError\">>, RegId) ->\n     lager:error(\"internal server error ~p~n\", [RegId]),\n     ok;\n \n-handle_error(<<\"InvalidRegistration\">>, RegId) ->\n-    %% Invalid registration id in database.\n-    lager:warning(\"invalid registration ~p~n\", [RegId]),\n-    ok;\n-\n-handle_error(<<\"NotRegistered\">>, RegId) ->\n-    %% Application removed. Delete device from database.\n-    lager:warning(\"not registered ~p~n\", [RegId]),\n-    ok;\n-\n handle_error(UnexpectedError, RegId) ->\n     %% There was an unexpected error that couldn't be identified.\n     lager:error(\"unexpected error ~p in ~p~n\", [UnexpectedError, RegId]),\n     ok.\n \n+handle_error_generic(Error, Function, Args) ->\n+  case application:get_env(gcm, feedback) of\n+    {ok, Funcs} ->\n+      case proplists:get_value(Function, Funcs) of\n+        {Mod,Func} ->\n+          erlang:apply(Mod, Func, Args),","path":"src/gcm.erl","position":40,"original_position":40,"commit_id":"76ead05cd35718977cee1a6899b548c33374d2a8","original_commit_id":"76ead05cd35718977cee1a6899b548c33374d2a8","user":{"login":"jaynel","id":184987,"avatar_url":"https://avatars.githubusercontent.com/u/184987?","gravatar_id":"20507ed2cfb8acfc1197d4153736f939","url":"https://api.github.com/users/jaynel","html_url":"https://github.com/jaynel","followers_url":"https://api.github.com/users/jaynel/followers","following_url":"https://api.github.com/users/jaynel/following{/other_user}","gists_url":"https://api.github.com/users/jaynel/gists{/gist_id}","starred_url":"https://api.github.com/users/jaynel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaynel/subscriptions","organizations_url":"https://api.github.com/users/jaynel/orgs","repos_url":"https://api.github.com/users/jaynel/repos","events_url":"https://api.github.com/users/jaynel/events{/privacy}","received_events_url":"https://api.github.com/users/jaynel/received_events","type":"User","site_admin":false},"body":"apply is rarely used, unless you are a tool maker. Why do you think you need to use apply?","created_at":"2014-05-01T23:32:23Z","updated_at":"2014-05-01T23:32:23Z","html_url":"https://github.com/tigertext/gcm-erlang/pull/5#discussion_r12213384","pull_request_url":"https://api.github.com/repos/tigertext/gcm-erlang/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/tigertext/gcm-erlang/pulls/comments/12213384"},"html":{"href":"https://github.com/tigertext/gcm-erlang/pull/5#discussion_r12213384"},"pull_request":{"href":"https://api.github.com/repos/tigertext/gcm-erlang/pulls/5"}}}}