I'm creating a rest API, using ASP.net Core and bit-framework
We want to allow the clients to be able to delete just the resources that they have created themselves
Questions:
In case a client asks to delete a resource which is created by another client,
what is the best exception to raise in the API?
What is the most correct HTTP status code to return?
All the exception implemented in
Bit.Owin.Exceptions
namespace are:\BadRequestException
ResourceNotFoundException
AppException
DomainLogicException
should I stick to this list of exceptions in my API? Is this list of exceptions going to be including more exceptions to cover more scenarios?
I think one of these status codes must be returned, but which one suites better our condition?:
- 403 Forbidden
- 405 Not Allowed
- 409 Resource Conflict