{"id":216,"date":"2022-08-30T14:57:39","date_gmt":"2022-08-30T14:57:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/08\/24\/categorise-uiwebview-errors-and-display-on-iphone-app-record-and-share-programming-errors\/"},"modified":"2022-08-30T14:57:39","modified_gmt":"2022-08-30T14:57:39","slug":"categorise-uiwebview-errors-and-display-on-iphone-app-record-and-share-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/categorise-uiwebview-errors-and-display-on-iphone-app-record-and-share-programming-errors\/","title":{"rendered":"categorise UIWebView errors and display on iphone app?-Record and share programming errors"},"content":{"rendered":"<p>is their any category for UIWebView possible errors? in my app i need to display the actual error occurred while loading url. i can print the error in didFailLoadWithError method , but in gives a long description about the error something like<\/p>\n<pre><code>didFailLoadWithError Error Domain=NSURLErrorDomain Code=-1003 \"A server with the specified hostname could not be found.\" UserInfo=0x895fb10 {NSErrorFailingURLStringKey=https:\/\/mobilelogin.bwanet.ca\/mdninput.html?csphostid=J13y8E9t000Mb3ZK00001H7R, NSErrorFailingURLKey=https:\/\/mobilelogin.bwanet.ca\/mdninput.html?csphostid=J13y8E9t000Mb3ZK00001H7R, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0x8c68f20 \"A server with the specified hostname could not be found.\"}\n<\/code><\/pre>\n<p>how will i categorise these possible errors and i want to display it like &#8220;specified hostname could not be found&#8221; &#8220;url timeout error&#8221; etc.<\/p>\n<ol>\n<li>\n<p>okay, in didFailWithError method<\/p>\n<pre><code>if (error.code==NSURLErrorTimedOut) {\n\n      errorReason=@\"URL Time Out Error \";\n\n   }\n    else if (error.code==NSURLErrorCannotFindHost) {\n      errorReason=@\"Cannot Find Host \";\n\n   }\n       else if (error.code==NSURLErrorCannotConnectToHost) {\n           errorReason=@\"Cannot Connect To Host\";\n\n    }\n             else if (error.code==NSURLErrorNetworkConnectionLost) {\n               errorReason=@\"Network Connection Lost\";\n\n       }\n                   else if (error.code==NSURLErrorUnknown) {\n                        errorReason=@\"Unknown Error\";\n\n             }\n                               else {\n                                   errorReason=@\"Loading Failed\";\n\n                   }\n UIAlertView *errorAlert=[[UIAlertView alloc]initWithTitle:errorReason message:@\"Redirecting to the server failed. do you want to EXIT the app\"  delegate:self cancelButtonTitle:@\"EXIT\" otherButtonTitles:@\"RELOAD\", nil];\n\n\n  [errorAlert show];\n  [errorAlert release];\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-08-24 14:13:32. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>is their any category for UIWebView possible errors? in my app i need to display the actual error occurred while loading url. i can print the error in didFailLoadWithError method , but in gives a long description about the error something like didFailLoadWithError Error Domain=NSURLErrorDomain Code=-1003 &#8220;A server with the specified hostname could not be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-216","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}