serp-spider / core

:spider: The PHP SERP Spider - A search engine scraper
https://serp-spider.github.io/
Other
89 stars 44 forks source link

New RequestError/ResponseException #10

Closed RubtsovAV closed 8 years ago

RubtsovAV commented 8 years ago

Throw that if response from SearchEgine is undefined.

This need for manual analysis by SE response.

It's necessary for that PR https://github.com/serp-spider/search-engine-google/pull/23

gsouf commented 8 years ago

I think it will be better to update the HttpResponseException with what you did in the PR (httpResponseException uses http status code as first parameter, but instead it should use the whole response as you use in this PR).

Can you do that? If you dont understand what I mean, please let me know.

If you use some IDE, then check for usage of the HttpResponseErrorException constructor to replace it

RubtsovAV commented 8 years ago

Do you mean that the new exception is not necessary, and we can use the existing HttpResponseException? But there not much comfortable. There have only HTTP status code. And user can't get full information about response. New Exception be more usefull, I think. Or may be I don't unerstand you fully?

RubtsovAV commented 8 years ago

Or you mean that to replace HttpResponseErrorException for behavior as new Exception and fix all place where it use? Then it be full copy of behavior?

Then it is necessary to replace a PageNotFoundException too.

gsouf commented 8 years ago

I mean update HttpResponseErrorException and replace the status code with the whole response.

Leave the task to me, that will be fast

gsouf commented 8 years ago

I close it, I updated it in d29b63f5f9ff329b77afa9882b04294fd0c39a94

RubtsovAV commented 8 years ago

Your implimentation is better. Thanks.