If a category does not exist, it should return a 400 with an explicit message #30

Open
opened 2024-06-23 21:56:51 +00:00 by satprog · 0 comments
Owner
$ curl -v -X PUT --header "Content-Type: application/json" --data '{"category": "xxx" }' localhost:9000/transactions/6240

* Host localhost:9000 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:9000...
* Connected to localhost (::1) port 9000
> PUT /transactions/6240 HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/8.8.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 20
> 
* upload completely sent off: 20 bytes
< HTTP/1.1 500 Internal Server Error
< Date: Sun, 23 Jun 2024 21:52:40 GMT
< Content-Length: 0
< 
* Connection #0 to host localhost left intact

2024/06/23 22:52:40 DAL::TransactionExists
2024/06/23 22:52:40 DAL::UpdateTransaction
2024/06/23 22:52:40 ERROR: insert or update on table "transactions_categorized" violates foreign key constraint "fk_transactions_categorized_name_categories" (SQLSTATE 23503)
{"time":"2024-06-23T22:52:40.792240294+01:00","id":"","remote_ip":"::1","host":"localhost:9000","method":"PUT","uri":"/transactions/6240","user_agent":"curl/8.8.0","status":500,"error":"","latency":8959518,"latency_human":"8.959518ms","bytes_in":20,"bytes_out":0}

``` $ curl -v -X PUT --header "Content-Type: application/json" --data '{"category": "xxx" }' localhost:9000/transactions/6240 * Host localhost:9000 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:9000... * Connected to localhost (::1) port 9000 > PUT /transactions/6240 HTTP/1.1 > Host: localhost:9000 > User-Agent: curl/8.8.0 > Accept: */* > Content-Type: application/json > Content-Length: 20 > * upload completely sent off: 20 bytes < HTTP/1.1 500 Internal Server Error < Date: Sun, 23 Jun 2024 21:52:40 GMT < Content-Length: 0 < * Connection #0 to host localhost left intact ``` > 2024/06/23 22:52:40 DAL::TransactionExists > 2024/06/23 22:52:40 DAL::UpdateTransaction > 2024/06/23 22:52:40 ERROR: insert or update on table "transactions_categorized" violates foreign key constraint "fk_transactions_categorized_name_categories" (SQLSTATE 23503) > {"time":"2024-06-23T22:52:40.792240294+01:00","id":"","remote_ip":"::1","host":"localhost:9000","method":"PUT","uri":"/transactions/6240","user_agent":"curl/8.8.0","status":500,"error":"","latency":8959518,"latency_human":"8.959518ms","bytes_in":20,"bytes_out":0}
satprog added this to the /transactions milestone 2024-06-23 21:56:51 +00:00
satprog added the
bug
label 2024-06-23 21:56:51 +00:00
satprog added this to the Client-Server architecture project 2024-06-23 21:56:51 +00:00
Sign in to join this conversation.
No description provided.