ONAP Guidelines
Finally found general ONAP Advise:
"The API specification should describe the right HTTP status code to return the client.
Status codes should align with IETF's HTTP Status Code Registry: https://www.ietf.org/assignments/http-status-codes/http-status-codes.xml"
Agreed CPS API(SPI) Exception Hierarchy
(see CCSDK-2871 DP: Long-term Java API(s)
- CPSValidationException
- ModelValidationException
- SpecificException1
- SpecificException2
- DataValidationException
- SpecificException3
- SpecificException4
- PathValidationException
- SpecificException5
- ModelValidationException
*Note we might have to move these 'common' exceptions classes to the SPI just like we did with the common data objects
Vertical slice view of error scenarios
# | Use case | Scenario | DB Response | SPI Response | Java API | REST API Response Code | REST message | |
---|---|---|---|---|---|---|---|---|
1 | Add schema set to dataspace | schema set with same name already exists | DataIntegrityViolationException | DuplicateSchemaSetException (extends ModelValidationException) | DuplicateSchemaSetException | TBD | TBD | |
2 | Add schema set to dataspace | dataspacename does not exist | depends on impl, I assume no records found | DatasspaceNotFoundException | DatasspaceNotFoundException | TBD | TBD | |
3 | List anchors for dataspace name | dataspacename does not exist | depends on impl, I assume no records found | DatasspaceNotFoundException | DatasspaceNotFoundException | 204 ? | TBD | |
4 | List anchors for dataspace name | no anchor records in DB | 0 records | empty collection | empty collection | 200 ? | TBD | |
5 | ||||||||
6 | ||||||||
7 |