Bug 28020 introduces the option to return error codes instead of just textual descriptions. Let's use that!
Created attachment 128924 [details] [review] Bug 29772: Regression tests
Created attachment 128925 [details] [review] Bug 29772: Make DELETE /patrons/:patron_id return error codes This patch makes the controller add the error_code attribute on error conditions payload. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Boo, the API doesn't include the error_code attribute on the error responses for the DELETE /patrons/:patron_id route 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! error_code is included in the response! 5. Sign off :-D
Created attachment 128926 [details] [review] Bug 29772: (follow-up) Document error codes
Created attachment 128941 [details] [review] Bug 29772: Regression tests Signed-off-by: David Nind <david@davidnind.com>
Created attachment 128942 [details] [review] Bug 29772: Make DELETE /patrons/:patron_id return error codes This patch makes the controller add the error_code attribute on error conditions payload. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Boo, the API doesn't include the error_code attribute on the error responses for the DELETE /patrons/:patron_id route 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! error_code is included in the response! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com>
Created attachment 128943 [details] [review] Bug 29772: (follow-up) Document error codes Signed-off-by: David Nind <david@davidnind.com>
Created attachment 129001 [details] [review] Bug 29772: Regression tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 129002 [details] [review] Bug 29772: Make DELETE /patrons/:patron_id return error codes This patch makes the controller add the error_code attribute on error conditions payload. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Boo, the API doesn't include the error_code attribute on the error responses for the DELETE /patrons/:patron_id route 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! error_code is included in the response! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 129003 [details] [review] Bug 29772: (follow-up) Document error codes Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]