Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "try..catch bullshit"
-
Today,I found this gem:
static function getConfig(){
$cacheKey = 'foobar';
try {
$config = $this->repository->getConfig();
$this->cache->set($cacheKey, $config);
}
catch(Exception $e){
try{
$config = $this->repository->getConfig();
$this->cache->set($cacheKey, $config);
}
catch(Exception $e){}
}
}
I don't want to live on this planet anymore...!7 -
Last Monday I bought an iPhone as a little music player, and just to see how iOS works or doesn't work.. which arguments against Apple are valid, which aren't etc. And at a price point of €60 for a secondhand SE I figured, why not. And needless to say I've jailbroken it shortly after.
Initially setting up the iPhone when coming from fairly unrestricted Android ended up being quite a chore. I just wanted to use this thing as a music player, so how would you do it..?
Well you first have to set up the phone, iCloud account and whatnot, yada yada... Asks for an email address and flat out rejects your email address if it's got "apple" in it, catch-all email servers be damned I guess. So I chose ishit at my domain instead, much better. Address information for billing.. just bullshit that, give it some nulls. Phone number.. well I guess I could just give it a secondary SIM card's number.
So now the phone has been set up, more or less. To get music on it was quite a maze solving experience in its own right. There's some stuff about it on the Debian and Arch Wikis but it's fairly outdated. From the iPhone itself you can install VLC and use its app directory, which I'll get back to later. Then from e.g. Safari, download any music file.. which it downloads to iCloud.. Think Different I guess. Go to your iCloud and pull it into the iPhone for real this time. Now you can share the file to your VLC app, at which point it initializes a database for that particular app.
The databases / app storage can be considered equivalent to the /data directories for applications in Android, minus /sdcard. There is little to no shared storage between apps, most stuff works through sharing from one app to another.
Now you can connect the iPhone to your computer and see a mount point for your pictures, and one for your documents. In that documents mount point, there are directories for each app, which you can just drag files into. For some reason the AFC protocol just hangs up when you try to delete files from your computer however... Think Different?
Anyway, the music has been put on it. Such features, what a nugget! It's less bad than I thought, but still pretty fucked up.
At that point I was fairly dejected and that didn't get better with an update from iOS 14.1 to iOS 14.3. Turns out that Apple in its nannying galore now turns down the volume to 50% every half an hour or so, "for hearing safety" and "EU regulations" that don't exist. Saying that I was fuming and wanting to smack this piece of shit into the wall would be an understatement. And even among the iSheep, I found very few people that thought this is fine. Though despite all that, there were still some. I have no idea what it would take to make those people finally reconsider.. maybe Tim Cook himself shoving an iPhone up their ass, or maybe they'd be honored that Tim Cook noticed them even then... But I digress.
And then, then it really started to take off because I finally ended up jailbreaking the thing. Many people think that it's only third-party apps, but that is far from true. It is equivalent to rooting, and you do get access to a Unix root account by doing it. The way you do it is usually a bootkit, which in a desktop's ring model would be a negative ring. The access level is extremely high.
So you can root it, great. What use is that in a locked down system where there's nothing available..? Aha, that's where the next thing comes in, 2 actually. Cydia has an OpenSSH server in it, and it just binds to port 22 and supports all of OpenSSH's known goodness. All of it, I'm using ed25519 keys and a CA to log into my phone! Fuck yea boi, what a nugget! This is better than Android even! And it doesn't end there.. there's a second thing it has up its sleeve. This thing has an apt package manager in it, which is easily equivalent to what Termux offers, at the system level! You can install not just common CLI applications, but even graphical apps from Cydia over the network!
Without a jailbreak, I would say that iOS is pretty fucking terrible and if you care about modding, you shouldn't use it. But jailbroken, fufu.. this thing trades many blows with Android in the modding scene. I've said it before, but what a nugget!8 -
Android development sucks assssssssssss.
They FINALLY made a design system that doesn't look ugly so I thought might as well upgrade my old apps to it.
Publish and tonnnnes of crashes hours after launch.
Test on older devices and turns out some @color/material_xyz was missing in a lower API code BUT available in higher ones? No fallback, no error in AndroidStudio, just a runtime crash. Amazing
Then the location permissions glitch up. On lower androids even if you aren't actively tracking the user, the system tries to call some method which if you haven't overridden, the app crashes at launch.
And no amount of wrapping in try-catch-ignore helps (https://stackoverflow.com/questions... helped)
OH AND THEN the above solution if used on latest Android code33, CRASHES ON RUNTIME. so more sets of 'if VCODE this then ask this else that' bullshit.
I don't even need location it's just for better ad money ffs.
I've been team-android since Froyo and hate apple's monopoly, but if this is the level of their competence, many will jump ship sooner or later.
PS: yes I know I should've checked for lower versions before hand but Im not gonna make 8 android VMs to test all when different things fail in different versions.
I did have to do that in the end, but for a meh pet project one shouldn't have to. The system should have enough fallbacks and graceful fails.3 -
"Exception has been thrown by the target of an invocation"
This error message pisses me off. I know the SSIS Script component is capable of catching exceptions, you can wrap all your code in a try/catch (please don't) and get an exception. So would it be so hard that if the Script Component throws an exception that it tells me what it is instead of sending me on a goddamn scavenger hunt?
The whole bullshit system of errors is why I hate SSIS. Just tell me what went wrong.
I did what I wasn't supposed to do, wrapped it in a try catch and it gave me a stack trace and an error message and all sorts of actionable shit. But why the hell can't it just do that on its own?
There is literally nothing worse, except maybe Hitler, than a goddamn vague error message.4