René's URL Explorer Experiment


Title: [Android] Unable to handle error response coming from server · Issue #282 · NativeScript/nativescript-background-http · GitHub

Open Graph Title: [Android] Unable to handle error response coming from server · Issue #282 · NativeScript/nativescript-background-http

X Title: [Android] Unable to handle error response coming from server · Issue #282 · NativeScript/nativescript-background-http

Description: Please, tell us how to recreate the issue in as much detail as possible. when api fails with 400 status server is sending error response but I'm unable to read it, I'm able read response only in case of success. Package.json ` "tns-andro...

Open Graph Description: Please, tell us how to recreate the issue in as much detail as possible. when api fails with 400 status server is sending error response but I'm unable to read it, I'm able read response only in ca...

X Description: Please, tell us how to recreate the issue in as much detail as possible. when api fails with 400 status server is sending error response but I'm unable to read it, I'm able read response on...

Opengraph URL: https://github.com/NativeScript/nativescript-background-http/issues/282

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Android] Unable to handle error response coming from server","articleBody":"### Please, tell us how to recreate the issue in as much detail as possible. \r\nwhen api fails with 400 status server is sending error response but I'm unable to read it, I'm able read response only in case of success.\r\n\r\n### Package.json\r\n\r\n   `\r\n    \r\n      \"tns-android\": {\r\n        \"version\": \"6.5.3\"\r\n      },\r\n      \"tns-ios\": {\r\n        \"version\": \"6.5.4\"\r\n      }\r\n    },\r\n    \"scripts\": {\r\n      \"clean\": \"tns platform clean ios \u0026\u0026 tns platform clean android\",\r\n      \"android\": \"tns run android --env.aot\",\r\n      \"ios\": \"tns run ios --env.aot\",\r\n      \"ios-prod\": \"tns run ios --env.aot --env.name=production\",\r\n      \"android-prod\": \"tns run android --env.aot --env.name=production\",\r\n      \"deploy\": \"./appcenter_deploy.sh \",\r\n      \"lint\": \"tslint \\\"src/**/*.ts\\\"\"\r\n    },\r\n    \"dependencies\": {\r\n      \"@angular/animations\": \"~8.2.0\",\r\n      \"@angular/common\": \"~8.2.0\",\r\n      \"@angular/compiler\": \"~8.2.0\",\r\n      \"@angular/core\": \"~8.2.0\",\r\n      \"@angular/forms\": \"~8.2.0\",\r\n      \"@angular/http\": \"8.0.0-beta.10\",\r\n      \"@angular/platform-browser\": \"~8.2.0\",\r\n      \"@angular/platform-browser-dynamic\": \"~8.2.0\",\r\n      \"@angular/router\": \"~8.2.0\",\r\n      \"@ngx-translate/core\": \"^11.0.1\",\r\n      \"@ngx-translate/http-loader\": \"^4.0.0\",\r\n      \"@ngxs-labs/emitter\": \"^2.0.0\",\r\n      \"@ngxs/store\": \"^3.6.1\",\r\n      \"@nstudio/nativescript-cardview\": \"^1.0.0\",\r\n      \"@nstudio/nativescript-checkbox\": \"^1.0.0\",\r\n      \"@nstudio/nativescript-loading-indicator\": \"3.0.4\",\r\n      \"@nstudio/nativescript-pulltorefresh\": \"^1.1.1\",\r\n      \"ajv\": \"^6.10.0\",\r\n      \"base-64\": \"^0.1.0\",\r\n      \"bootstrap\": \"^4.3.1\",\r\n      \"core-js\": \"3.4.1\",\r\n      \"d3-ease\": \"^1.0.6\",\r\n      \"i\": \"^0.3.6\",\r\n      \"jquery\": \"^3.4.1\",\r\n      \"moment\": \"^2.24.0\",\r\n      \"nativescript-android-utils\": \"^1.0.2\",\r\n      \"nativescript-angular\": \"^8.20.1\",\r\n      \"nativescript-appavailability\": \"^1.3.2\",\r\n      \"nativescript-appversion\": \"^1.4.2\",\r\n      \"nativescript-audio\": \"^5.0.5\",\r\n      \"nativescript-azure-mobile-apps\": \"^2.0.3\",\r\n      \"nativescript-background-http\": \"4.2.0\",\r\n      \"nativescript-camera\": \"^4.5.0\",\r\n      \"nativescript-drawingpad\": \"^3.1.0\",\r\n      \"nativescript-drop-down\": \"^5.0.4\",\r\n      \"nativescript-email\": \"^1.5.5\",\r\n      \"nativescript-exit\": \"^1.0.1\",\r\n      \"nativescript-fingerprint-auth\": \"^7.0.2\",\r\n      \"nativescript-geolocation\": \"^5.1.0\",\r\n      \"nativescript-imagepicker\": \"^7.1.0\",\r\n      \"nativescript-iqkeyboardmanager\": \"^1.5.1\",\r\n      \"nativescript-local-notifications\": \"^4.1.5\",\r\n      \"nativescript-mediafilepicker\": \"^3.0.1\",\r\n      \"nativescript-microsoft-appcenter\": \"^2.0.0\",\r\n      \"nativescript-permissions\": \"^1.3.8\",\r\n      \"nativescript-phone\": \"^1.4.0\",\r\n      \"nativescript-photo-editor\": \"^1.1.0\",\r\n      \"nativescript-plugin-firebase\": \"^10.3.1\",\r\n      \"nativescript-secure-storage\": \"^2.6.0\",\r\n      \"nativescript-swiss-army-knife\": \"^4.0.2\",\r\n      \"nativescript-theme-core\": \"^2.0.24\",\r\n      \"nativescript-toasty\": \"^3.0.0-alpha.2\",\r\n      \"nativescript-ui-calendar\": \"^6.0.0\",\r\n      \"nativescript-ui-dataform\": \"^6.0.0\",\r\n      \"nativescript-ui-listview\": \"^8.0.0\",\r\n      \"nativescript-ui-sidedrawer\": \"^8.0.0\",\r\n      \"npm\": \"^6.14.4\",\r\n      \"popper.js\": \"^1.15.0\",\r\n      \"reflect-metadata\": \"~0.1.12\",\r\n      \"rxjs\": \"^6.4.0\",\r\n      \"tns-core-modules\": \"^6.5.20\",\r\n      \"zone.js\": \"^0.9.1\"\r\n    },\r\n    \"devDependencies\": {\r\n      \"@angular-devkit/build-angular\": \"^0.901.0\",\r\n      \"@angular/cli\": \"^8.3.18\",\r\n      \"@angular/compiler-cli\": \"~8.2.0\",\r\n      \"@nativescript/schematics\": \"~0.7.3\",\r\n      \"@ngtools/webpack\": \"~8.2.0\",\r\n      \"@types/d3-ease\": \"^1.0.9\",\r\n      \"@types/jasmine\": \"2.8.6\",\r\n      \"@types/jasminewd2\": \"~2.0.3\",\r\n      \"@types/node\": \"12.6.3\",\r\n      \"codelyzer\": \"^5.0.1\",\r\n      \"nativescript-dev-webpack\": \"^1.5.1\",\r\n      \"node-sass\": \"^4.13.1\",\r\n      \"protractor\": \"^6.0.0\",\r\n      \"tns-android\": \"6.5.3\",\r\n      \"tns-ios\": \"6.5.4\",\r\n      \"tns-platform-declarations\": \"6.4.2\",\r\n      \"ts-node\": \"8.5.0\",\r\n      \"tslint\": \"5.18.0\",\r\n      \"typescript\": \"3.4.5\"\r\n    },\r\n  }\r\n   `\r\n\r\n### muitipart-handler.service\r\n`public multipartUpload(url: string, token: string, bgSessionName: string,\r\n                            params: any, androidNotificationTitle: string = 'Sync complete') {\r\n\r\n        const session = bgHttp.session(bgSessionName);\r\n        const name = 'test';\r\n        const description = `${name} (${++this.counter})`;\r\n        const request = {\r\n            url: url,\r\n            method: 'POST',\r\n            headers: {\r\n                Authorization: this.apiHelper.getAuthHeaderAsString(token),\r\n                'Content-Disposition': 'form-data; name=' + name + 'filename=' + name,\r\n                'Content-Type': 'application/octet-stream'\r\n\r\n            },\r\n            description: description,\r\n            androidAutoDeleteAfterUpload: false,\r\n            androidNotificationTitle: androidNotificationTitle,\r\n            androidAutoClearNotification: true\r\n        };\r\n\r\n        setTimeout(() =\u003e { // Timeout of 20 seconds. If the upload doesn't complete in 20 seconds. it will return a 408.\r\n            if (!this.finishedUploading) {\r\n                this.response.next({responseCode: 408, data: 'Multipart upload timed out'});\r\n            }\r\n        }, 20000);\r\n\r\n        const task = session.multipartUpload(params, request);\r\n        this.bindTask(task);\r\n        return this.response;\r\n    }\r\n\r\n    /**\r\n     * Bind the task to the events. This will create callbacks for every stage of the call.\r\n     * (responsed, progress, complete, error)\r\n     *\r\n     * To get the response code and data from the response, please subscribe on MultipartHandlerService.response\r\n     *\r\n     * @param task - bgHttp.Task\r\n     */\r\n    private bindTask(task: bgHttp.Task): any {\r\n        task.on('progress', this.onEvent.bind(this));\r\n        task.on('error', this.onEvent.bind(this));\r\n        task.on('responded', this.onEvent.bind(this));\r\n        task.on('complete', this.onEvent.bind(this));\r\n        this.lastEvent = '';\r\n    }\r\n\r\n    private onEvent(e): Observable\u003cboolean\u003e {\r\n        if (this.lastEvent !== e.eventName) {\r\n            // suppress all repeating progress events and only show the first one\r\n            this.lastEvent = e.eventName;\r\n        } else {\r\n            return;\r\n        }\r\n        if ( e.eventName === 'complete') {\r\n            console.log('completehandler')\r\n            this.finishedUploading = true;\r\n            this.response.next({responseCode: e.responseCode, data: JSON.parse(this.data)});\r\n        }\r\n\r\n        if ( e.eventName === 'responded') {\r\n            console.log('respondhandler')\r\n            this.data = e.data;\r\n            console.log(e.data)\r\n        }\r\n\r\n        if ( e.eventName === 'error') {\r\n            console.log(`Multipart HTTP error.\r\n                        ResponseCode: ${e.responseCode},\r\n                        Response: ${e.response}`);\r\n        }\r\n\r\n        this.events.push({\r\n            eventTitle: e.eventName + ' ' + e.object.description,\r\n            eventData: JSON.stringify({\r\n                error: e.error ? e.error.toString() : e.error,\r\n                currentBytes: e.currentBytes,\r\n                totalBytes: e.totalBytes,\r\n                body: e.data,\r\n                responseCode: e.responseCode\r\n            })\r\n        });\r\n    }\r\n}\r\n`\r\n","author":{"url":"https://github.com/Srikanthjava972","@type":"Person","name":"Srikanthjava972"},"datePublished":"2022-02-01T10:42:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/282/nativescript-background-http/issues/282"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a24b40ac-df6e-5172-7d96-dc4cdc314c8d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id927A:EBF9C:25E6702:31FA2B5:6992DCEF
html-safe-nonce0f44fe124fe1b8be0dea240d92045fb907028a8f9032c81c61bb8142af6f8189
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjdBOkVCRjlDOjI1RTY3MDI6MzFGQTJCNTo2OTkyRENFRiIsInZpc2l0b3JfaWQiOiI0MDQ1NjY2NjU5ODA5Mjg3NDA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc8f0de02b9c12b4ea635f65b24d4cdd5285e6de8a5f1a25e935bf27613b1b5c2
hovercard-subject-tagissue:1120500600
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-background-http/282/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ec26ed4baf9e9dab802108ba0feaed23ac22e3f508e10cfe8bc44cf1cf2c89e7/NativeScript/nativescript-background-http/issues/282
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ec26ed4baf9e9dab802108ba0feaed23ac22e3f508e10cfe8bc44cf1cf2c89e7/NativeScript/nativescript-background-http/issues/282
og:image:altPlease, tell us how to recreate the issue in as much detail as possible. when api fails with 400 status server is sending error response but I'm unable to read it, I'm able read response only in ca...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSrikanthjava972
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/nativescript-background-http git https://github.com/NativeScript/nativescript-background-http.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id41672178
octolytics-dimension-repository_nwoNativeScript/nativescript-background-http
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id41672178
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-background-http
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84dcb133269e3cfe6e0296cc85fbacb92cae92bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues/282#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-background-http%2Fissues%2F282
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-background-http%2Fissues%2F282
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2Fnativescript-background-http
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues/282
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues/282
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues/282
NativeScript https://patch-diff.githubusercontent.com/NativeScript
nativescript-background-httphttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http
Please reload this pagehttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues/282
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-background-http
Fork 50 https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-background-http
Star 102 https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-background-http
Code https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http
Issues 29 https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues
Pull requests 2 https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/pulls
Actions https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/actions
Projects 0 https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/projects
Security 0 https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/security
Insights https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/pulse
Code https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http
Issues https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues
Pull requests https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/pulls
Actions https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/actions
Projects https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/projects
Security https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/security
Insights https://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/NativeScript/nativescript-background-http/issues/282
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/NativeScript/nativescript-background-http/issues/282
[Android] Unable to handle error response coming from serverhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-background-http/issues/282#top
https://github.com/Srikanthjava972
https://github.com/Srikanthjava972
Srikanthjava972https://github.com/Srikanthjava972
on Feb 1, 2022https://github.com/NativeScript/nativescript-background-http/issues/282#issue-1120500600
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.