{"action":"created","comment":{"url":"https://api.github.com/repos/Talend/ui/pulls/comments/185404469","pull_request_review_id":116783673,"id":185404469,"diff_hunk":"@@ -111,6 +117,74 @@ export function httpFetch(url, config, method, payload) {\n \t\t.then(handleHttpResponse)\n \t\t.catch(handleError);\n }\n+export function cloneError(initialError, resultError) {\n+\tconst errorToEnrich = Object.assign({}, resultError);\n+\treturn initialError.stack.response\n+\t\t.clone()\n+\t\t.text()\n+\t\t.then(response => {\n+\t\t\ttry {\n+\t\t\t\terrorToEnrich.stack.response = response;\n+\t\t\t\terrorToEnrich.stack.messageObject = JSON.parse(response);\n+\t\t\t\treturn Promise.resolve(errorToEnrich);\n+\t\t\t} catch (exception) {\n+\t\t\t\terrorToEnrich.stack.messageObject = 'Parsing response error';\n+\t\t\t\treturn Promise.reject(errorToEnrich);\n+\t\t\t}\n+\t\t});\n+}\n+export function* errorProcessing(error, httpAction) {\n+\tconst errorObject = {\n+\t\tname: error.name,\n+\t\tmessage: error.description || error.message,\n+\t\tnumber: error.number,\n+\t\tstack: error.stack,\n+\t};\n+\tconst clone = get(error, 'stack.response.clone');\n+\tif (!clone) {\n+\t\tyield put(onJSError(errorObject, httpAction));\n+\t} else {\n+\t\t// clone the response object else the next call to text or json\n+\t\t// triggers an exception Already use\n+\t\tconst clonedError = cloneError(error);\n+\t\tif (httpAction.onError) {\n+\t\t\tyield put(onActionError(httpAction, clonedError));\n+\t\t}\n+\n+\t\tif (typeof httpAction.onError !== 'function') {\n+\t\t\tyield put(onHttpError(httpAction, clonedError));\n+\t\t}\n+\t}\n+}\n+\n+export const handleDefaultConfiguration = curry((defaultConfig, config) =>\n+\tmergeCSRFToken(defaultConfig)(config),\n+);\n+\n+function normalizeParameters(\n+\turlOrBag,\n+\tconfig,\n+\tmethod = HTTP_METHODS.GET,\n+\tpayload,\n+\tcmf,\n+\tdefaultConfig,\n+) {\n+\tconst configEnhancer = handleDefaultConfiguration(defaultConfig);\n+\tif (isObject(urlOrBag)) {\n+\t\treturn {\n+\t\t\t...urlOrBag,\n+\t\t\tconfig: configEnhancer(urlOrBag.config),\n+\t\t};\n+\t}\n+\n+\treturn {","path":"packages/cmf/src/sagas/http.js","position":99,"original_position":99,"commit_id":"be5885fbcdf1dac73b8dcf5c1ae9bb883bf949c2","original_commit_id":"be5885fbcdf1dac73b8dcf5c1ae9bb883bf949c2","user":{"login":"jmfrancois","id":19857479,"avatar_url":"https://avatars2.githubusercontent.com/u/19857479?v=4","gravatar_id":"","url":"https://api.github.com/users/jmfrancois","html_url":"https://github.com/jmfrancois","followers_url":"https://api.github.com/users/jmfrancois/followers","following_url":"https://api.github.com/users/jmfrancois/following{/other_user}","gists_url":"https://api.github.com/users/jmfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/jmfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmfrancois/subscriptions","organizations_url":"https://api.github.com/users/jmfrancois/orgs","repos_url":"https://api.github.com/users/jmfrancois/repos","events_url":"https://api.github.com/users/jmfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/jmfrancois/received_events","type":"User","site_admin":false},"body":"We should ensure url is a string, either throw an new Error","created_at":"2018-05-02T06:39:44Z","updated_at":"2018-05-02T06:39:44Z","html_url":"https://github.com/Talend/ui/pull/1276#discussion_r185404469","pull_request_url":"https://api.github.com/repos/Talend/ui/pulls/1276","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Talend/ui/pulls/comments/185404469"},"html":{"href":"https://github.com/Talend/ui/pull/1276#discussion_r185404469"},"pull_request":{"href":"https://api.github.com/repos/Talend/ui/pulls/1276"}}},"pull_request":{"url":"https://api.github.com/repos/Talend/ui/pulls/1276","id":181251267,"html_url":"https://github.com/Talend/ui/pull/1276","diff_url":"https://github.com/Talend/ui/pull/1276.diff","patch_url":"https://github.com/Talend/ui/pull/1276.patch","issue_url":"https://api.github.com/repos/Talend/ui/issues/1276","number":1276,"state":"open","locked":false,"title":"feat(cmf): http cmf convention on http saga","user":{"login":"sgendre","id":31214611,"avatar_url":"https://avatars3.githubusercontent.com/u/31214611?v=4","gravatar_id":"","url":"https://api.github.com/users/sgendre","html_url":"https://github.com/sgendre","followers_url":"https://api.github.com/users/sgendre/followers","following_url":"https://api.github.com/users/sgendre/following{/other_user}","gists_url":"https://api.github.com/users/sgendre/gists{/gist_id}","starred_url":"https://api.github.com/users/sgendre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgendre/subscriptions","organizations_url":"https://api.github.com/users/sgendre/orgs","repos_url":"https://api.github.com/users/sgendre/repos","events_url":"https://api.github.com/users/sgendre/events{/privacy}","received_events_url":"https://api.github.com/users/sgendre/received_events","type":"User","site_admin":false},"body":"**What is the problem this PR is trying to solve?**\r\nHttp request handled by sagas doesn't handle configuration like those triggered through cmf, with \r\nonResponse, onSend, onError, tranform, collectionId\r\n\r\n**What is the chosen solution to this problem?**\r\nMake those 2 work hand by hand.\r\n+ add a \"responseSelector\" that allows to select within the response object what data actually matters\r\n","created_at":"2018-04-12T15:59:02Z","updated_at":"2018-05-02T06:39:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f57d3fe59546a26f8a4f850cb3163efa6d4f4821","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":526309312,"url":"https://api.github.com/repos/Talend/ui/labels/work%20in%20progress","name":"work in progress","color":"d93f0b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Talend/ui/pulls/1276/commits","review_comments_url":"https://api.github.com/repos/Talend/ui/pulls/1276/comments","review_comment_url":"https://api.github.com/repos/Talend/ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Talend/ui/issues/1276/comments","statuses_url":"https://api.github.com/repos/Talend/ui/statuses/be5885fbcdf1dac73b8dcf5c1ae9bb883bf949c2","head":{"label":"Talend:sgendre/feat/cmf-convention-on-http-saga","ref":"sgendre/feat/cmf-convention-on-http-saga","sha":"be5885fbcdf1dac73b8dcf5c1ae9bb883bf949c2","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":79343946,"name":"ui","full_name":"Talend/ui","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/ui","description":"Talend's unified web UI repository.","fork":false,"url":"https://api.github.com/repos/Talend/ui","forks_url":"https://api.github.com/repos/Talend/ui/forks","keys_url":"https://api.github.com/repos/Talend/ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/ui/teams","hooks_url":"https://api.github.com/repos/Talend/ui/hooks","issue_events_url":"https://api.github.com/repos/Talend/ui/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/ui/events","assignees_url":"https://api.github.com/repos/Talend/ui/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/ui/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/ui/tags","blobs_url":"https://api.github.com/repos/Talend/ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/ui/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/ui/languages","stargazers_url":"https://api.github.com/repos/Talend/ui/stargazers","contributors_url":"https://api.github.com/repos/Talend/ui/contributors","subscribers_url":"https://api.github.com/repos/Talend/ui/subscribers","subscription_url":"https://api.github.com/repos/Talend/ui/subscription","commits_url":"https://api.github.com/repos/Talend/ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/ui/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/ui/merges","archive_url":"https://api.github.com/repos/Talend/ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/ui/downloads","issues_url":"https://api.github.com/repos/Talend/ui/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/ui/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/ui/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/ui/labels{/name}","releases_url":"https://api.github.com/repos/Talend/ui/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/ui/deployments","created_at":"2017-01-18T13:45:58Z","updated_at":"2018-04-27T15:22:57Z","pushed_at":"2018-05-01T08:26:57Z","git_url":"git://github.com/Talend/ui.git","ssh_url":"git@github.com:Talend/ui.git","clone_url":"https://github.com/Talend/ui.git","svn_url":"https://github.com/Talend/ui","homepage":"http://talend.surge.sh","size":26378,"stargazers_count":51,"watchers_count":51,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":18,"open_issues":55,"watchers":51,"default_branch":"master"}},"base":{"label":"Talend:master","ref":"master","sha":"248f3faeaf7818e60d2c6fef01f6cc707dc64064","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":79343946,"name":"ui","full_name":"Talend/ui","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/ui","description":"Talend's unified web UI repository.","fork":false,"url":"https://api.github.com/repos/Talend/ui","forks_url":"https://api.github.com/repos/Talend/ui/forks","keys_url":"https://api.github.com/repos/Talend/ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/ui/teams","hooks_url":"https://api.github.com/repos/Talend/ui/hooks","issue_events_url":"https://api.github.com/repos/Talend/ui/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/ui/events","assignees_url":"https://api.github.com/repos/Talend/ui/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/ui/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/ui/tags","blobs_url":"https://api.github.com/repos/Talend/ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/ui/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/ui/languages","stargazers_url":"https://api.github.com/repos/Talend/ui/stargazers","contributors_url":"https://api.github.com/repos/Talend/ui/contributors","subscribers_url":"https://api.github.com/repos/Talend/ui/subscribers","subscription_url":"https://api.github.com/repos/Talend/ui/subscription","commits_url":"https://api.github.com/repos/Talend/ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/ui/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/ui/merges","archive_url":"https://api.github.com/repos/Talend/ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/ui/downloads","issues_url":"https://api.github.com/repos/Talend/ui/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/ui/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/ui/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/ui/labels{/name}","releases_url":"https://api.github.com/repos/Talend/ui/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/ui/deployments","created_at":"2017-01-18T13:45:58Z","updated_at":"2018-04-27T15:22:57Z","pushed_at":"2018-05-01T08:26:57Z","git_url":"git://github.com/Talend/ui.git","ssh_url":"git@github.com:Talend/ui.git","clone_url":"https://github.com/Talend/ui.git","svn_url":"https://github.com/Talend/ui","homepage":"http://talend.surge.sh","size":26378,"stargazers_count":51,"watchers_count":51,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":18,"open_issues":55,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Talend/ui/pulls/1276"},"html":{"href":"https://github.com/Talend/ui/pull/1276"},"issue":{"href":"https://api.github.com/repos/Talend/ui/issues/1276"},"comments":{"href":"https://api.github.com/repos/Talend/ui/issues/1276/comments"},"review_comments":{"href":"https://api.github.com/repos/Talend/ui/pulls/1276/comments"},"review_comment":{"href":"https://api.github.com/repos/Talend/ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Talend/ui/pulls/1276/commits"},"statuses":{"href":"https://api.github.com/repos/Talend/ui/statuses/be5885fbcdf1dac73b8dcf5c1ae9bb883bf949c2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jmfrancois"}}