olback / library-loader

[Unofficial] Samacsys Library Loader for all platforms!
112 stars 21 forks source link

handle error when componentsearchengine's terms and conditions change #42

Closed tobiasvogel closed 4 years ago

tobiasvogel commented 4 years ago

Every now and then, the Samacsys' componentsearchengines Terms and Conditions change. Upon login on their site, one is prompted to read and agree/disagree to their updated Terms and Conditions.

The library loader failed with the error "Error downloading file: Could not determine content type". It took me quite some time to figure out what the problem was, as i wrongly suspected a bug in the library loader.

A simple solution was to implement a check, as the model.php (as in const 'COMPONENT_SEARCH_ENGINE_URL') simply returns this plain text string in such case:

Error: Our terms and conditions have changed. You need to log in at https://componentsearchengine.com and accept the new terms before downloading models.

olback commented 4 years ago

Thanks for reporting this. This is something that never even crossed my mind.

olback commented 4 years ago

For this error to occur, componentsearchengine.com has to respond with a status of OK, but the status obviously isn't ok...

olback commented 4 years ago

Note added in last version.