{"action":"created","comment":{"url":"https://api.github.com/repos/lkania/Haskitter/pulls/comments/90999061","pull_request_review_id":11510785,"id":90999061,"diff_hunk":"@@ -1114,10 +1114,73 @@ type AppHandler = Handler Haskitter Haskitter\n Por último quisieramos aclarar que el tipo `AppHanlder` comentado durante el desarrollo, es solamente un alias de `Handler Haskitter Haskitter`, es decir, un web `Handler` que recibe una `Snaplet` `Haskitter` y retorna una `Snaplet` `Haskitter`.\n \n \n+### Manejo de errores\n+\n+Los errores no simepre se manejaron mediante la monada `ExceptT`. Originalmente toda la aplicación se había realizado utilizando funciones que retornaba valores del tipo `AppHandler Maybe a`. Por ejemplo, alizemos la implementación anterior de `loginHandler`.\n+\n+```haskell\n+loginHandler :: (User -> AppHandler ()) -> AppHandler ()\n+loginHandler handler = do\n+  user_email    <- getParam \"user_email\"\n+  user_password <- getParam \"user_password\"\n+  maybe_user    <- checkParam user_email    \"No email\"    (return Nothing) (\\u_email ->\n+                   checkParam user_password \"No password\" (return Nothing) (\\u_password ->\n+                   loginHandler' u_email u_password ))\n+  case maybe_user of\n+    Nothing -> return ()\n+    Just user -> handler user\n+```\n+\n+Al principio obtenemos los parametros \"user_email\" y \"user_password\" del HTTP Request. Y luego verificamos mediante la función `checkParam` que los parametros no sean `Nothing` sino `Just BS.ByteString`.\n+\n+```haskell\n+```\n+\n+Podemos ver por la función `checkParam` que un error implicada escribir en la HTTP Reply el error que se había generado y luego retornar `Nothing` de manera que la funcioón `loginHandler` pueda continuar su flujo normal.\n+\n+En caso de que ambos parametros se hubieran enviado correctamente se pocedia a ejecutar la función `loginHandler`.  ","path":"README.md","position":28,"original_position":28,"commit_id":"c11d0eeff50c60c70e017c2d5b6090cc39c7db26","original_commit_id":"c11d0eeff50c60c70e017c2d5b6090cc39c7db26","user":{"login":"francoprud","id":8209847,"avatar_url":"https://avatars.githubusercontent.com/u/8209847?v=3","gravatar_id":"","url":"https://api.github.com/users/francoprud","html_url":"https://github.com/francoprud","followers_url":"https://api.github.com/users/francoprud/followers","following_url":"https://api.github.com/users/francoprud/following{/other_user}","gists_url":"https://api.github.com/users/francoprud/gists{/gist_id}","starred_url":"https://api.github.com/users/francoprud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francoprud/subscriptions","organizations_url":"https://api.github.com/users/francoprud/orgs","repos_url":"https://api.github.com/users/francoprud/repos","events_url":"https://api.github.com/users/francoprud/events{/privacy}","received_events_url":"https://api.github.com/users/francoprud/received_events","type":"User","site_admin":false},"body":"En caso de que ambos parámetros se hubieran enviado correctamente se procedía a ejecutar la función `loginHandler`.  ","created_at":"2016-12-06T02:07:00Z","updated_at":"2016-12-06T02:07:00Z","html_url":"https://github.com/lkania/Haskitter/pull/12#discussion_r90999061","pull_request_url":"https://api.github.com/repos/lkania/Haskitter/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/lkania/Haskitter/pulls/comments/90999061"},"html":{"href":"https://github.com/lkania/Haskitter/pull/12#discussion_r90999061"},"pull_request":{"href":"https://api.github.com/repos/lkania/Haskitter/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/lkania/Haskitter/pulls/12","id":96626827,"html_url":"https://github.com/lkania/Haskitter/pull/12","diff_url":"https://github.com/lkania/Haskitter/pull/12.diff","patch_url":"https://github.com/lkania/Haskitter/pull/12.patch","issue_url":"https://api.github.com/repos/lkania/Haskitter/issues/12","number":12,"state":"open","locked":false,"title":"add new errors management explanation","user":{"login":"lkania","id":4495040,"avatar_url":"https://avatars.githubusercontent.com/u/4495040?v=3","gravatar_id":"","url":"https://api.github.com/users/lkania","html_url":"https://github.com/lkania","followers_url":"https://api.github.com/users/lkania/followers","following_url":"https://api.github.com/users/lkania/following{/other_user}","gists_url":"https://api.github.com/users/lkania/gists{/gist_id}","starred_url":"https://api.github.com/users/lkania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkania/subscriptions","organizations_url":"https://api.github.com/users/lkania/orgs","repos_url":"https://api.github.com/users/lkania/repos","events_url":"https://api.github.com/users/lkania/events{/privacy}","received_events_url":"https://api.github.com/users/lkania/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-05T22:55:38Z","updated_at":"2016-12-06T02:12:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1877a28ef3856a424b3d20180471f7c429e5a58","assignee":{"login":"francoprud","id":8209847,"avatar_url":"https://avatars.githubusercontent.com/u/8209847?v=3","gravatar_id":"","url":"https://api.github.com/users/francoprud","html_url":"https://github.com/francoprud","followers_url":"https://api.github.com/users/francoprud/followers","following_url":"https://api.github.com/users/francoprud/following{/other_user}","gists_url":"https://api.github.com/users/francoprud/gists{/gist_id}","starred_url":"https://api.github.com/users/francoprud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francoprud/subscriptions","organizations_url":"https://api.github.com/users/francoprud/orgs","repos_url":"https://api.github.com/users/francoprud/repos","events_url":"https://api.github.com/users/francoprud/events{/privacy}","received_events_url":"https://api.github.com/users/francoprud/received_events","type":"User","site_admin":false},"assignees":[{"login":"francoprud","id":8209847,"avatar_url":"https://avatars.githubusercontent.com/u/8209847?v=3","gravatar_id":"","url":"https://api.github.com/users/francoprud","html_url":"https://github.com/francoprud","followers_url":"https://api.github.com/users/francoprud/followers","following_url":"https://api.github.com/users/francoprud/following{/other_user}","gists_url":"https://api.github.com/users/francoprud/gists{/gist_id}","starred_url":"https://api.github.com/users/francoprud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francoprud/subscriptions","organizations_url":"https://api.github.com/users/francoprud/orgs","repos_url":"https://api.github.com/users/francoprud/repos","events_url":"https://api.github.com/users/francoprud/events{/privacy}","received_events_url":"https://api.github.com/users/francoprud/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lkania/Haskitter/pulls/12/commits","review_comments_url":"https://api.github.com/repos/lkania/Haskitter/pulls/12/comments","review_comment_url":"https://api.github.com/repos/lkania/Haskitter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lkania/Haskitter/issues/12/comments","statuses_url":"https://api.github.com/repos/lkania/Haskitter/statuses/c11d0eeff50c60c70e017c2d5b6090cc39c7db26","head":{"label":"lkania:errors-readme","ref":"errors-readme","sha":"c11d0eeff50c60c70e017c2d5b6090cc39c7db26","user":{"login":"lkania","id":4495040,"avatar_url":"https://avatars.githubusercontent.com/u/4495040?v=3","gravatar_id":"","url":"https://api.github.com/users/lkania","html_url":"https://github.com/lkania","followers_url":"https://api.github.com/users/lkania/followers","following_url":"https://api.github.com/users/lkania/following{/other_user}","gists_url":"https://api.github.com/users/lkania/gists{/gist_id}","starred_url":"https://api.github.com/users/lkania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkania/subscriptions","organizations_url":"https://api.github.com/users/lkania/orgs","repos_url":"https://api.github.com/users/lkania/repos","events_url":"https://api.github.com/users/lkania/events{/privacy}","received_events_url":"https://api.github.com/users/lkania/received_events","type":"User","site_admin":false},"repo":{"id":60384426,"name":"Haskitter","full_name":"lkania/Haskitter","owner":{"login":"lkania","id":4495040,"avatar_url":"https://avatars.githubusercontent.com/u/4495040?v=3","gravatar_id":"","url":"https://api.github.com/users/lkania","html_url":"https://github.com/lkania","followers_url":"https://api.github.com/users/lkania/followers","following_url":"https://api.github.com/users/lkania/following{/other_user}","gists_url":"https://api.github.com/users/lkania/gists{/gist_id}","starred_url":"https://api.github.com/users/lkania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkania/subscriptions","organizations_url":"https://api.github.com/users/lkania/orgs","repos_url":"https://api.github.com/users/lkania/repos","events_url":"https://api.github.com/users/lkania/events{/privacy}","received_events_url":"https://api.github.com/users/lkania/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lkania/Haskitter","description":null,"fork":false,"url":"https://api.github.com/repos/lkania/Haskitter","forks_url":"https://api.github.com/repos/lkania/Haskitter/forks","keys_url":"https://api.github.com/repos/lkania/Haskitter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lkania/Haskitter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lkania/Haskitter/teams","hooks_url":"https://api.github.com/repos/lkania/Haskitter/hooks","issue_events_url":"https://api.github.com/repos/lkania/Haskitter/issues/events{/number}","events_url":"https://api.github.com/repos/lkania/Haskitter/events","assignees_url":"https://api.github.com/repos/lkania/Haskitter/assignees{/user}","branches_url":"https://api.github.com/repos/lkania/Haskitter/branches{/branch}","tags_url":"https://api.github.com/repos/lkania/Haskitter/tags","blobs_url":"https://api.github.com/repos/lkania/Haskitter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lkania/Haskitter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lkania/Haskitter/git/refs{/sha}","trees_url":"https://api.github.com/repos/lkania/Haskitter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lkania/Haskitter/statuses/{sha}","languages_url":"https://api.github.com/repos/lkania/Haskitter/languages","stargazers_url":"https://api.github.com/repos/lkania/Haskitter/stargazers","contributors_url":"https://api.github.com/repos/lkania/Haskitter/contributors","subscribers_url":"https://api.github.com/repos/lkania/Haskitter/subscribers","subscription_url":"https://api.github.com/repos/lkania/Haskitter/subscription","commits_url":"https://api.github.com/repos/lkania/Haskitter/commits{/sha}","git_commits_url":"https://api.github.com/repos/lkania/Haskitter/git/commits{/sha}","comments_url":"https://api.github.com/repos/lkania/Haskitter/comments{/number}","issue_comment_url":"https://api.github.com/repos/lkania/Haskitter/issues/comments{/number}","contents_url":"https://api.github.com/repos/lkania/Haskitter/contents/{+path}","compare_url":"https://api.github.com/repos/lkania/Haskitter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lkania/Haskitter/merges","archive_url":"https://api.github.com/repos/lkania/Haskitter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lkania/Haskitter/downloads","issues_url":"https://api.github.com/repos/lkania/Haskitter/issues{/number}","pulls_url":"https://api.github.com/repos/lkania/Haskitter/pulls{/number}","milestones_url":"https://api.github.com/repos/lkania/Haskitter/milestones{/number}","notifications_url":"https://api.github.com/repos/lkania/Haskitter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lkania/Haskitter/labels{/name}","releases_url":"https://api.github.com/repos/lkania/Haskitter/releases{/id}","deployments_url":"https://api.github.com/repos/lkania/Haskitter/deployments","created_at":"2016-06-03T23:54:39Z","updated_at":"2016-06-03T23:58:46Z","pushed_at":"2016-12-06T02:04:24Z","git_url":"git://github.com/lkania/Haskitter.git","ssh_url":"git@github.com:lkania/Haskitter.git","clone_url":"https://github.com/lkania/Haskitter.git","svn_url":"https://github.com/lkania/Haskitter","homepage":null,"size":230,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"lkania:master","ref":"master","sha":"dbe2f5ed3543d1f12129f964c4a33d213d174d42","user":{"login":"lkania","id":4495040,"avatar_url":"https://avatars.githubusercontent.com/u/4495040?v=3","gravatar_id":"","url":"https://api.github.com/users/lkania","html_url":"https://github.com/lkania","followers_url":"https://api.github.com/users/lkania/followers","following_url":"https://api.github.com/users/lkania/following{/other_user}","gists_url":"https://api.github.com/users/lkania/gists{/gist_id}","starred_url":"https://api.github.com/users/lkania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkania/subscriptions","organizations_url":"https://api.github.com/users/lkania/orgs","repos_url":"https://api.github.com/users/lkania/repos","events_url":"https://api.github.com/users/lkania/events{/privacy}","received_events_url":"https://api.github.com/users/lkania/received_events","type":"User","site_admin":false},"repo":{"id":60384426,"name":"Haskitter","full_name":"lkania/Haskitter","owner":{"login":"lkania","id":4495040,"avatar_url":"https://avatars.githubusercontent.com/u/4495040?v=3","gravatar_id":"","url":"https://api.github.com/users/lkania","html_url":"https://github.com/lkania","followers_url":"https://api.github.com/users/lkania/followers","following_url":"https://api.github.com/users/lkania/following{/other_user}","gists_url":"https://api.github.com/users/lkania/gists{/gist_id}","starred_url":"https://api.github.com/users/lkania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkania/subscriptions","organizations_url":"https://api.github.com/users/lkania/orgs","repos_url":"https://api.github.com/users/lkania/repos","events_url":"https://api.github.com/users/lkania/events{/privacy}","received_events_url":"https://api.github.com/users/lkania/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lkania/Haskitter","description":null,"fork":false,"url":"https://api.github.com/repos/lkania/Haskitter","forks_url":"https://api.github.com/repos/lkania/Haskitter/forks","keys_url":"https://api.github.com/repos/lkania/Haskitter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lkania/Haskitter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lkania/Haskitter/teams","hooks_url":"https://api.github.com/repos/lkania/Haskitter/hooks","issue_events_url":"https://api.github.com/repos/lkania/Haskitter/issues/events{/number}","events_url":"https://api.github.com/repos/lkania/Haskitter/events","assignees_url":"https://api.github.com/repos/lkania/Haskitter/assignees{/user}","branches_url":"https://api.github.com/repos/lkania/Haskitter/branches{/branch}","tags_url":"https://api.github.com/repos/lkania/Haskitter/tags","blobs_url":"https://api.github.com/repos/lkania/Haskitter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lkania/Haskitter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lkania/Haskitter/git/refs{/sha}","trees_url":"https://api.github.com/repos/lkania/Haskitter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lkania/Haskitter/statuses/{sha}","languages_url":"https://api.github.com/repos/lkania/Haskitter/languages","stargazers_url":"https://api.github.com/repos/lkania/Haskitter/stargazers","contributors_url":"https://api.github.com/repos/lkania/Haskitter/contributors","subscribers_url":"https://api.github.com/repos/lkania/Haskitter/subscribers","subscription_url":"https://api.github.com/repos/lkania/Haskitter/subscription","commits_url":"https://api.github.com/repos/lkania/Haskitter/commits{/sha}","git_commits_url":"https://api.github.com/repos/lkania/Haskitter/git/commits{/sha}","comments_url":"https://api.github.com/repos/lkania/Haskitter/comments{/number}","issue_comment_url":"https://api.github.com/repos/lkania/Haskitter/issues/comments{/number}","contents_url":"https://api.github.com/repos/lkania/Haskitter/contents/{+path}","compare_url":"https://api.github.com/repos/lkania/Haskitter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lkania/Haskitter/merges","archive_url":"https://api.github.com/repos/lkania/Haskitter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lkania/Haskitter/downloads","issues_url":"https://api.github.com/repos/lkania/Haskitter/issues{/number}","pulls_url":"https://api.github.com/repos/lkania/Haskitter/pulls{/number}","milestones_url":"https://api.github.com/repos/lkania/Haskitter/milestones{/number}","notifications_url":"https://api.github.com/repos/lkania/Haskitter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lkania/Haskitter/labels{/name}","releases_url":"https://api.github.com/repos/lkania/Haskitter/releases{/id}","deployments_url":"https://api.github.com/repos/lkania/Haskitter/deployments","created_at":"2016-06-03T23:54:39Z","updated_at":"2016-06-03T23:58:46Z","pushed_at":"2016-12-06T02:04:24Z","git_url":"git://github.com/lkania/Haskitter.git","ssh_url":"git@github.com:lkania/Haskitter.git","clone_url":"https://github.com/lkania/Haskitter.git","svn_url":"https://github.com/lkania/Haskitter","homepage":null,"size":230,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lkania/Haskitter/pulls/12"},"html":{"href":"https://github.com/lkania/Haskitter/pull/12"},"issue":{"href":"https://api.github.com/repos/lkania/Haskitter/issues/12"},"comments":{"href":"https://api.github.com/repos/lkania/Haskitter/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/lkania/Haskitter/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/lkania/Haskitter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lkania/Haskitter/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/lkania/Haskitter/statuses/c11d0eeff50c60c70e017c2d5b6090cc39c7db26"}}}}
{"actor":{"display_login":"francoprud"}}