{"action":"created","comment":{"url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/comments/73449243","id":73449243,"diff_hunk":"@@ -0,0 +1,54 @@\n+---\n+template: multi-example\n+title: Error handler \n+anchor: error-handler\n+code_examples:\n+  python:\n+    lang: python\n+    request: |\n+      from .error_handler import NoOpErrorHandler as error_handler\n+\n+      optimizely = optimizely.Optimizely(datafile,\n+                                         event_dispatcher=event_dispatcher,\n+                                         logger=logger,\n+                                         error_handler=error_handler)\n+  java:\n+    lang: java\n+    request: |\n+      String datafile = \"{}\";\n+      // Creates an error handler that throws exceptions on errors\n+      ErrorHandler errorHandler = new RaiseExceptionErrorHandler();\n+      Optimizely optimizely = Optimizely.builder(datafile, eventHandler)\n+          .withErrorHandler(errorHandler);\n+          .build();\n+\n+  ruby:\n+    lang: ruby\n+    request: |\n+      require_relative 'optimizely/error_handler'\n+\n+      optimizely = Optimizely::Project.new(datafile,\n+                                           EventDispatcher.new,\n+                                           NoOpLogger.new,\n+                                           NoOpErrorHandler.new)\n+  javascript:\n+    lang: javascript\n+    request: |\n+      var defaultErrorHandler = require('optimizely-server-sdk/lib/plugins/error_handler');\n+\n+      optimizely = optimizely.createInstance({\n+        datafile: datafile,\n+        errorHandler: defaultErrorHandler,\n+        eventDispatcher: defaultEventDispatcher,\n+        logger: defaultLogger.createLogger(),\n+      });\n+---\n+\n+You can provide your own custom error handler logic by overriding the `handle_error/handleError` function, which will allow you to standardize error handling across your production environment. ","path":"src/content/server/reference/custom/3-error.md","position":47,"original_position":47,"commit_id":"911306c81bce4f4cae0aa7a9f171fc792fdfea95","original_commit_id":"911306c81bce4f4cae0aa7a9f171fc792fdfea95","user":{"login":"aliabbasrizvi","id":1548776,"avatar_url":"https://avatars.githubusercontent.com/u/1548776?v=3","gravatar_id":"","url":"https://api.github.com/users/aliabbasrizvi","html_url":"https://github.com/aliabbasrizvi","followers_url":"https://api.github.com/users/aliabbasrizvi/followers","following_url":"https://api.github.com/users/aliabbasrizvi/following{/other_user}","gists_url":"https://api.github.com/users/aliabbasrizvi/gists{/gist_id}","starred_url":"https://api.github.com/users/aliabbasrizvi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliabbasrizvi/subscriptions","organizations_url":"https://api.github.com/users/aliabbasrizvi/orgs","repos_url":"https://api.github.com/users/aliabbasrizvi/repos","events_url":"https://api.github.com/users/aliabbasrizvi/events{/privacy}","received_events_url":"https://api.github.com/users/aliabbasrizvi/received_events","type":"User","site_admin":false},"body":"Like logger we also have a raise all exception error handler as well.","created_at":"2016-08-04T01:13:58Z","updated_at":"2016-08-04T01:13:58Z","html_url":"https://github.com/optimizely/developers.optimizely.com/pull/416#discussion_r73449243","pull_request_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416","_links":{"self":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/comments/73449243"},"html":{"href":"https://github.com/optimizely/developers.optimizely.com/pull/416#discussion_r73449243"},"pull_request":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416"}}},"pull_request":{"url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416","id":79998307,"html_url":"https://github.com/optimizely/developers.optimizely.com/pull/416","diff_url":"https://github.com/optimizely/developers.optimizely.com/pull/416.diff","patch_url":"https://github.com/optimizely/developers.optimizely.com/pull/416.patch","issue_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/416","number":416,"state":"open","locked":false,"title":"add eventValue, SDK links and custom config","user":{"login":"mauerbac","id":1507886,"avatar_url":"https://avatars.githubusercontent.com/u/1507886?v=3","gravatar_id":"","url":"https://api.github.com/users/mauerbac","html_url":"https://github.com/mauerbac","followers_url":"https://api.github.com/users/mauerbac/followers","following_url":"https://api.github.com/users/mauerbac/following{/other_user}","gists_url":"https://api.github.com/users/mauerbac/gists{/gist_id}","starred_url":"https://api.github.com/users/mauerbac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauerbac/subscriptions","organizations_url":"https://api.github.com/users/mauerbac/orgs","repos_url":"https://api.github.com/users/mauerbac/repos","events_url":"https://api.github.com/users/mauerbac/events{/privacy}","received_events_url":"https://api.github.com/users/mauerbac/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-03T23:51:20Z","updated_at":"2016-08-04T01:13:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04c8a8f98ab93cb660b2455ea3f6707f55e01b65","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416/commits","review_comments_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416/comments","review_comment_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/416/comments","statuses_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/statuses/911306c81bce4f4cae0aa7a9f171fc792fdfea95","head":{"label":"optimizely:matt/advanced","ref":"matt/advanced","sha":"911306c81bce4f4cae0aa7a9f171fc792fdfea95","user":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"repo":{"id":34077573,"name":"developers.optimizely.com","full_name":"optimizely/developers.optimizely.com","owner":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/optimizely/developers.optimizely.com","description":"Optimizely's developer documentation website.","fork":false,"url":"https://api.github.com/repos/optimizely/developers.optimizely.com","forks_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/forks","keys_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/teams","hooks_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/hooks","issue_events_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/events{/number}","events_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/events","assignees_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/assignees{/user}","branches_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/branches{/branch}","tags_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/tags","blobs_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/statuses/{sha}","languages_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/languages","stargazers_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/stargazers","contributors_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/contributors","subscribers_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/subscribers","subscription_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/subscription","commits_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/contents/{+path}","compare_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/merges","archive_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/downloads","issues_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues{/number}","pulls_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls{/number}","milestones_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/milestones{/number}","notifications_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/labels{/name}","releases_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/releases{/id}","deployments_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/deployments","created_at":"2015-04-16T20:01:04Z","updated_at":"2016-04-28T23:42:53Z","pushed_at":"2016-08-04T00:09:31Z","git_url":"git://github.com/optimizely/developers.optimizely.com.git","ssh_url":"git@github.com:optimizely/developers.optimizely.com.git","clone_url":"https://github.com/optimizely/developers.optimizely.com.git","svn_url":"https://github.com/optimizely/developers.optimizely.com","homepage":"http://developers.optimizely.com","size":47764,"stargazers_count":9,"watchers_count":9,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":9,"default_branch":"master"}},"base":{"label":"optimizely:master","ref":"master","sha":"09d74b3b3dd18067e13a100d0fd0f613f5aaf55e","user":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"repo":{"id":34077573,"name":"developers.optimizely.com","full_name":"optimizely/developers.optimizely.com","owner":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/optimizely/developers.optimizely.com","description":"Optimizely's developer documentation website.","fork":false,"url":"https://api.github.com/repos/optimizely/developers.optimizely.com","forks_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/forks","keys_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/teams","hooks_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/hooks","issue_events_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/events{/number}","events_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/events","assignees_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/assignees{/user}","branches_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/branches{/branch}","tags_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/tags","blobs_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/statuses/{sha}","languages_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/languages","stargazers_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/stargazers","contributors_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/contributors","subscribers_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/subscribers","subscription_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/subscription","commits_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/contents/{+path}","compare_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/merges","archive_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/downloads","issues_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues{/number}","pulls_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls{/number}","milestones_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/milestones{/number}","notifications_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/labels{/name}","releases_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/releases{/id}","deployments_url":"https://api.github.com/repos/optimizely/developers.optimizely.com/deployments","created_at":"2015-04-16T20:01:04Z","updated_at":"2016-04-28T23:42:53Z","pushed_at":"2016-08-04T00:09:31Z","git_url":"git://github.com/optimizely/developers.optimizely.com.git","ssh_url":"git@github.com:optimizely/developers.optimizely.com.git","clone_url":"https://github.com/optimizely/developers.optimizely.com.git","svn_url":"https://github.com/optimizely/developers.optimizely.com","homepage":"http://developers.optimizely.com","size":47764,"stargazers_count":9,"watchers_count":9,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416"},"html":{"href":"https://github.com/optimizely/developers.optimizely.com/pull/416"},"issue":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/416"},"comments":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/issues/416/comments"},"review_comments":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416/comments"},"review_comment":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/pulls/416/commits"},"statuses":{"href":"https://api.github.com/repos/optimizely/developers.optimizely.com/statuses/911306c81bce4f4cae0aa7a9f171fc792fdfea95"}}}}
{"actor":{"display_login":"aliabbasrizvi"}}