readium / readium-lcp-server

Repository for the Readium LCP Server
BSD 3-Clause "New" or "Revised" License
73 stars 57 forks source link

License generation with a wrong content id, should return err 404, not 500 #93

Closed llemeurfr closed 7 years ago

llemeurfr commented 7 years ago

In lcpserver/api/license.go, an error returned from completeLicense() should not always be expressed as err 500. In our case, if the key is not found, a 404 ("Content not found") is expected. Note that this error type is not found in problem.go, I guess it must be added.

snemegeer commented 7 years ago

If a normal error type exists (http 404 not found), we don't need to add an extra type. I'll just return the 404 / Not Found error code. (see also https://tools.ietf.org/html/rfc7807#section-4)

danielweck commented 7 years ago

Fixed via: https://github.com/readium/readium-lcp-server/commit/48a095a38fef4ed64efbab76dcaa7a385a017dd0 https://github.com/readium/readium-lcp-server/commit/b4ecffc5a0b0f3cd50575be83ccc745f05734337