News for hackers. Stuff that matters.
Re:If you're just going to sit there doing nothing, at least... by thfuran on Friday February 16, 2024 @05:06PM (#39403577)
That is a dangerous assumption. Unless you know a great deal about every possible use case, you can't know the potential ramifications of incorrect output. Proceeding from invalid state (which would often be the result of swallowing errors) is essentially undefined behavior.
Re:If you're just going to sit there doing nothing, at least... by Arainach on Friday February 16, 2024 @05:57PM (#39404150)
This isn't invalid state. They're not telling the app about a fake corrupt printer, they are using the API contact to represent the truth (there is no printer you can use) in a way the app already has to support
Re:If you're just going to sit there doing nothing, at least... by thfuran on Friday February 16, 2024 @08:24PM (#39405370)
But I was responding to a general statement.
Re:If you're just going to sit there doing nothing, at least... by kelnos on Saturday February 17, 2024 @12:22AM (#39406670)
And I still think you're wrong. If incorrect input can't be handled gracefully in a way that you can be sure nothing bad will happen, it's possible that crashing is the best option.

But I think in most cases that just isn't what's going on. An unsupported API that makes a feature not work is just not a big deal. Lack of support, say, for a cryptographic primitive, could be a big deal, so you might choose to handle that case differently.

Re:If you're just going to sit there doing nothing, at least... by thfuran on Saturday February 17, 2024 @11:51AM (#39411118)
And would you treat an API endpoint that's down the same way? Just silently ignore that a feature that's part of the user's workflow isn't actually working, that maybe only half of what was supposed to happen when they pressed a button actually happened?
Re:If you're just going to sit there doing nothing, at least... by kelnos on Saturday February 17, 2024 @12:20AM (#39406660)
Yes, and in the case presented in the article -- trying to print on an Xbox -- we really do actually know the potential ramifications of trying to print and then being presented with no printers to print to. Simply: there are no ramifications worth worrying about.

On the other hand, we do know what will probably happen if an undocumented exception gets thrown: the app will crash, possibly causing the user to lose data.