http-error

Retrofit 2 + RxAndroid: Handle Errors (4xx and some 200)

冷暖自知 提交于 2019-12-06 02:31:29
I saw a lot of articles and questions about error handling using retrofit combined with RxAndroid, but i am not able to set my configuration right. What do I want to accomplish: when receiving a 4xx code: handle it on onError() when receiving a 2xx code: -> try to parse to expected response and deliver it onNext() -> If not possible try to convert the JSON answer to MyAPIError class (simple POJO with errorNum and message) and deliver it on onError. So either 2xx or 4xx http codes might end up in onError(). What do I have at the moment: ServiceGenerator.java public class ServiceGenerator {

The request was aborted: The request was canceled. No solution works

余生颓废 提交于 2019-12-05 22:59:38
问题 Our console applications are making hundreds of WebRequests to Facebook every minute (with using multiple apps and hundreds of access tokens). Now, they started to fail with the exception message in the title ("The request was aborted: The request was canceled"). We searched for hours on the internet, and tried out every possible solution, but nothing helped. These didn't help: webRequest.Timeout = 20000; //A request that didn't get respond within 20 seconds is unacceptable, and we would

how to fix HTTP error fetching URL. Status=500 in java while crawling?

那年仲夏 提交于 2019-12-05 03:33:19
I am trying to crawl the user's ratings of cinema movies of imdb from the review page: (number of movies in my database is about 600,000). I used jsoup to parse pages as below: (sorry, I didn't write the whole code here since it is too long) try { //connecting to mysql db ResultSet res = st .executeQuery("SELECT id, title, production_year " + "FROM title " + "WHERE kind_id =1 " + "LIMIT 0 , 100000"); while (res.next()){ ....... ....... String baseUrl = "http://www.imdb.com/search/title?release_date=" + ""+year+","+year+"&title="+movieName+"" + "&title_type=feature,short,documentary,unknown";

Instagram/feed API media URL shows 'URL signature expired'

試著忘記壹切 提交于 2019-12-04 09:58:55
问题 I am using Instagram feed API to show my Instagram posts on my Website. But some video URL shows ' URL signature expired '. Any solution for me ? 回答1: Instagram has added URL signatures to their media URLs. You can easily remove the URL signature using this regular expression: "vp.*/.{32}/.{8}/" For example in PHP: preg_replace('/vp.*\/.{32}\/.{8}\//', '', $mediaUrl) On the other hand, I don't think that removing the URL signature is the best solution (is just a quick fix). The good one is to

The request was aborted: The request was canceled. No solution works

人盡茶涼 提交于 2019-12-04 03:28:02
Our console applications are making hundreds of WebRequests to Facebook every minute (with using multiple apps and hundreds of access tokens). Now, they started to fail with the exception message in the title ("The request was aborted: The request was canceled"). We searched for hours on the internet, and tried out every possible solution, but nothing helped. These didn't help: webRequest.Timeout = 20000; //A request that didn't get respond within 20 seconds is unacceptable, and we would rather just retry. webRequest.KeepAlive = false; webRequest.ProtocolVersion = HttpVersion.Version10;

HTTP 500 response using v1 linkedin companies shares api

孤街浪徒 提交于 2019-12-03 22:12:46
问题 It's been 2 days that trying to post content through LinkedIn API for a specific company page is failing with "Internal service error". Strangely, it only happens to this specific company page (id: 10684715) not any other company pages we post to! the code is in php. I have checked the company page to see if there is any information that helps and could find nothing. Also, posting the same content directly to LinkedIn works but not through API. Same code and similar requests worked previously

Recovering from HTTPError in Mechanize

爷,独闯天下 提交于 2019-12-03 16:52:24
问题 I am writing a function for some existing python code that will be passed a Mechanize browser object as a parameter. I fill in some details in a form in the browser, and use response = browser.submit() to move the browser to a new page, and collect some information from it. Unfortunately, I occasionally get the following error: httperror_seek_wrapper: HTTP Error 500: Internal Server Error I've navigated to the page in my own browser, and sure enough, I occasionally see this error directly, so

Accessing HTTP Error Response Body from HttpInterceptor in Angular

岁酱吖の 提交于 2019-12-03 12:13:17
问题 I have an HttpInterceptor to catch errors and display them in a modal. Besides error code and message, I would also like to show the body of the response which actually holds a more precise description of the error (e.g. on a 500 internal server error). How can I achieve this in angular? (I am using version 4.3.6.) I already looked at related questions but answers like HttpErrorResponse._body or similar don't work for me. Also, when inspecting the error response in the console,

web.config errors fail with responseMode=“File”

我怕爱的太早我们不能终老 提交于 2019-12-03 12:06:10
According to Microsoft's documentation , for static (i.e. HTML) content, web.config should read responseMode="File" for each error. Currently, my web.config includes <httpErrors errorMode="Custom"> <!-- remove statusCodes --> <error statusCode="404" path="/error/404.html" responseMode="ExecuteURL" /> </httpErrors> This returns the correct custom error page, but returns a 200 OK status code. When I change "ExecuteURL" to "File", my server does return a 404, but the custom error page is not displayed. Instead, I get the message "The resource you are looking for has been removed, had its name

Understanding “408 Request Timeout” on Apache with PHP

流过昼夜 提交于 2019-12-03 11:39:56
问题 Issue description - Apache logs I found items similar to this one in the Apache log file: 166.147.68.243 [24/Feb/2013:06:06:25 -0500] 19 web-site.com "-" 408 - "-" I’ve got custom log format and 408 here stands for status. The log format is: LogFormat "%h %t %D %V \"%r\" %>s %b \"%{User-agent}i\"" detailed And normally the line in the log file looks like 184.73.232.108 [26/Feb/2013:08:38:16 -0500] 30677 www.site.com "GET /api/search... HTTP/1.1" 200 205 "Zend_Http_Client" This is why 408