edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.75k stars 153 forks source link

OPDS, handle HTTP Problem Details #1536

Closed llemeurfr closed 2 years ago

llemeurfr commented 3 years ago

The support of HTTP Problem Details should be as generic as possible in Thorium. Here is a first use case, but every HTTP error returned by an OPDS server should be treated as well.

Use case: library books have a limited count of copies, and when all copies are already used, a new user cannot borrow it.

In practice: an OPDS feed contains acquisition links of type "borrow". A link is activated, but the server wants to abort the action. It does that by returning an HTTP error + a json object detailed in rfc7807.

Several applications handle such HTTP Problem Details documents, including Aldiko and SimplyE. There is explicit mention of this in ODL: https://drafts.opds.io/odl-1.0#54-interacting-with-a-checkout-link

The title and details of the HTTP Problem Details document should be based on the Accept-Language header of the client request. Therefore a modela box containing this information is displayed to the user.

More information: see Readium Slack, channel opds, 31/08/2021

llemeurfr commented 3 years ago

Almost a duplicate from #540, which was narrowed down to LCP.

panaC commented 3 years ago

https://datatracker.ietf.org/doc/html/rfc7807

C S :

{
    "type": "loans_limit_reached",
    "title": "You have reached the loan limit allowed by your library.",
    "status": 403
}