ocket8888 opened a new pull request, #6770:
URL: https://github.com/apache/trafficcontrol/pull/6770

   The initial purpose of this PR was just to remove 
`github.com/apache/trafficcontrol/lib/go-tc.DBError`, but in doing so I had to 
figure out what to do about the places it was being returned. So I changed the 
`github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.Validator` 
interface's `Validate` method to return two errors instead of one - a user 
error and a system error. There were a few places where a database error was 
being logged before `DBError` was returned where it now returns the actual 
error as a system error instead of logging it immediately, and I think there 
was at least one place where the error was just being totally discarded and 
that's now propagating upwards.
   
   Notably this means that in situations where an internal database process 
fails, the response code will now properly be a `500 Internal Server Error` 
whereas in many cases it used to be a `400 Bad Request` error.
   
   <hr/>
   
   ## Which Traffic Control components are affected by this PR?
   - Traffic Ops
   
   ## What is the best way to verify this PR?
   Make sure all the tests and stuff still pass. There shouldn't be any 
behavioral changes - except in the case of unknown server-side errors - so 
existing test cases should cover it pretty well.
   
   ## If this is a bugfix, which Traffic Control versions contained the bug?
   It's *technically* a bug in that it was returning an improper error code. I 
think that would affect every release since the first to include a Go version 
of Traffic Ops.
   
   ## PR submission checklist
   - [x] This PR has tests
   - [ ] This PR has documentation
   - [ ] This PR has a CHANGELOG.md entry
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to