{ "id": "137948", "key": "TIMOB-19591", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-12-09T18:10:54.000+0000", "created": "2014-10-10T21:21:18.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "404", "GET", "code", "createHttpClient", "error" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2019-12-09T18:10:54.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Create a new httpClient request, GET. In the onError callback ask for the http response code.\r\n\r\nPurposely make the URL to send a 404 not found\r\n\r\nIOS, simulator and device, you will get the 404 code, and any error handling will execute.\r\n\r\nAndroid will fail on both simulator and device. Http code returned is -1. You will also see an httpclient error in the console.\r\n\r\n{code:title=Sample index.js code|borderStyle=solid}\r\n\r\nvar dataUrl = \"http://www.whateverdomain.com/404page\"; // add your 404 test URL here\r\n\r\nfunction httptest()\r\n{\r\n\t\r\n\tvar xhr = Ti.Network.createHTTPClient({\r\n\t\tonload: function()\r\n\t\t{\r\n\t\t\t// whatever....\r\n\t\t},\r\n\t\tonerror: function(e) {\r\n\t\t\tTi.API.info(e.code);\r\n\t\t},\r\n\t\ttimeout: 60000\r\n\t\r\n\t});\r\n\t\r\n\txhr.open('GET', dataUrl);\r\n\txhr.send();\r\n}\r\n\r\nfunction init()\r\n{\r\n\t$.index.open();\r\n\t httptest();\r\n}\r\n\r\ninit();\r\n\r\n\r\n\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "createHttpClient GET request, when 404 Android onError http error code not received", "creator": { "name": "capsizeno4", "key": "capsizeno4", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "capsizeno4", "key": "capsizeno4", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.9.5, Titanium Studio, build: 3.3.0.201407100905", "comment": { "comments": [ { "id": "453093", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "nable to reproduce. Received the same 404 error on both iOS and Android.\r\n\r\nAxway Appcelerator Studio, build: 5.1.4.201909061933 \r\nmacOS : 10.15\r\nNode.js Version : 8.9.1\r\nnpm Version : 5.5.1\r\nAppcelerator CLI : 7.1.2\r\nTitanium CLI\r\nCLI Version : 5.2.1\r\nnode-appc Version : 0.2.49\r\nTitanium SDKs : 8.3.0.GA\r\niPhone 11 13.2.2\r\nPixel 3 Android API 29", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-09T18:10:54.000+0000", "updated": "2019-12-09T18:10:54.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }