Feed aggregator
Uber Is Locking Out NYC Drivers Mid-Shift To Lower Minimum Pay
Read more of this story at Slashdot.
Chinese Tech Companies Push Staff To the Limit
Read more of this story at Slashdot.
Head of Paris's Top Tech University Says Secret To France's AI Boom Is Focus on Humanities
Read more of this story at Slashdot.
Microsoft's Latest Surface Devices Almost As Easy To Fix As They Are To Break
Read more of this story at Slashdot.
Streaming Execs Think TV's Future Looks a Lot Like Its Past
Read more of this story at Slashdot.
Microsoft Quietly Removes Local Account Instructions for Windows 11
Read more of this story at Slashdot.
Major Record Labels Sue AI Company Behind 'BBL Drizzy'
Read more of this story at Slashdot.
Prosus Writes Down $22 Billion Education Startup Byju's To Zero
Read more of this story at Slashdot.
Amazon Labor Union, Airplane Hub Workers Ally with Teamsters Organizing Workers Nationwide
Read more of this story at Slashdot.
Apple's App Store Policies Charged Under New EU Competition Law
Read more of this story at Slashdot.
Slashdot Asks: What Do You Remember About the Web in 1994?
Read more of this story at Slashdot.
CodeSOD: Sdrawkcab Error Handling
When interacting with RESTful web services, there's a depressingly common anti-pattern: always return status 200 OK, but embed a more meaningful status code in the body of the response. Frequently, the embedded status code is just the HTTP status code you should have returned in the first place.
This "fixes" situations where you have badly behaving clients that don't do proper error handling, but also breaks the entire point of doing REST.
Alice works on an app that, while most of the time the code is decent, has a service that does this. This service also does something even worse: depending on the URL parameters you pass to the query, it may do something like this when it returns errors:
{ "statusCode": 422, "errors": { "Value should be an integer": [ "version" ] } }Or something like this:
{ "statusCode": 422, "errors": { "orderSatus": [ "The value you selected is not a valid choice." ] } }Sometimes, the service returns errors in the form "error message: [list of fields]", and sometimes it returns errors in the form "field: [list of errors]". I'd argue that the latter is more correct, but either is workable if they were at least consistent.
At first, looking at the responses, I assumed this was some multi-team, microservice situation where you had specification drift and two different teams solving the same problem slightly differently, but no: it's just one service, maintained by one small team.
These kinds of inconsistencies abound in the codebase. The entire thing is designed to make the front-end team pull their hair out, and any third parties consuming the API to go completely insane.
Alice writes: "I'm glad I only maintain the back-end and front-end is someone else's job."
Alice says that, but she clearly has her work cut out for her, too, if this is going to get any better.
[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!Amazon Retaliated After Employee Walkout Over Return-to-Office Policy, Says NLRB
Read more of this story at Slashdot.
Framework Laptop 13 is Getting a Drop-In RISC-V Mainboard Option
Read more of this story at Slashdot.
Why Washington's Mount Rainier Still Makes Volcanologists Worry
Read more of this story at Slashdot.
Apple Might Partner with Meta on AI
Read more of this story at Slashdot.
Michigan Lawmakers Advance Bill Requiring All Public High Schools To At Least Offer CS
Read more of this story at Slashdot.
Longtime Linux Wireless Developer Passes Away. RIP Larry Finger
Read more of this story at Slashdot.
OpenAI's 'Media Manager' Mocked, Amid Accusations of Robbing Creative Professionals
Read more of this story at Slashdot.
Tuesday SpaceX Launches a NOAA Satellite to Improve Weather Forecasts for Earth and Space
Read more of this story at Slashdot.