laminas-api-tools / api-tools-api-problem

Laminas Module providing API-Problem assets and rendering
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
8 stars 18 forks source link

Status code from exceptions #7

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

API Problem response with HTTP status code from exception when it's valid rage of HTTP codes. But what about situation when some library throws own exceptions, with own codes (example 302, and it means that user doesn't exist)? It does't make sense. My solution for this is to use code from exceptions only when exception implements \ZF\ApiProblem\Exception\ExceptionInterface


Originally posted by @snapshotpl at https://github.com/zfcampus/zf-api-problem/issues/26

weierophinney commented 4 years ago

:+1:


Originally posted by @michalkopacz at https://github.com/zfcampus/zf-api-problem/issues/26#issuecomment-63623826

weierophinney commented 4 years ago

Via http://tools.ietf.org/html/draft-nottingham-http-problem-07#section-4

Problem details are not a debugging tool for the underlying implementation; rather, they are a way to expose greater detail about the HTTP interface itself.


Originally posted by @snapshotpl at https://github.com/zfcampus/zf-api-problem/issues/26#issuecomment-69750265