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 - "$exception"
-
This made me laugh! ++ for the official Notepad++ exception dialog 😋 ...
Source: https://plus.google.com/+notepad-pl...5 -
Duplex: Hi, Umm... Can I book 3 seats on Wednesday?
Restaurant: Sure! And what time is it?
Duplex: Yeah, Oh, I'd like it at NullPointer Exception if it's possible.
Restaurant: Invalid parameter "NullPointer Exception" restarting program...4 -
Autocomplete in editors is like that annoying friend that keeps interrupt();ing every singletonInstance():le thing you try{}catch(Exception e)} to say, delay(1000);ing you COUNT(*)ntless of times.3
-
Me on Google: how to run node.js.....
Girlfriend shoulder surfing: wtf? Why do you want to run nude?
Exception caught9 -
At customer site with my boss.
Boss: let's check this code which is not working
Me: ok (starting the debugging session)
I found this code, which was failing during the writing on disk for some reasons.
try
{
....
writer.writeline(some data);
....
}
catch(Exception ex)
{
....
}
Boss: ok it fails to write data but we need to, let's manage it like this:
try
{
....
writer.writeline(some data);
....
}
catch(Exception ex)
{
writer.writeline(some data);
....
}12 -
A few weeks ago on a trip to Boston:
"Well lets use nine large screens to display this awesome Exception properly" ;-)7 -
Today is April 1, 2017. Saturday.
Okay, checking emails.
...
WTF errors in production??
Checking...
Oh...
throw new \Exception('April fools!')
-___-2 -
Girl I met asked what I do for fun outside of work and training. Brain threw nullreference exception.8
-
Latest from my team,
One of the Dev copied code from a stackoverflow question.
Got same exception as highlighted in the question and started complaining that his code does not work.3 -
I have been work at a company for about a year now and i havent seen an exception correctly handled ONCE.11
-
I'm used to go to work by bike every morning, but I'll make an exception this morning in particular 🤔18
-
Once I applied for a Java position and they sent me a a online test, user and password. When I first tried to log in, it gave me an java exception. I lost hours trying to figure out the exception , thinking it was the test :/5
-
Made a list of all my friends in Java.
then I run:
list.get(0);
I get: Index out of bound exception.
What is the problem, send help10 -
Just spent the whole day rewriting a 5,000 line function with variables like num55 or num287. These variables constantly get re-used for different purposes and overwritten at will.
Everything is now broken. Including my spirit.4 -
Void foo() {
try {
//Try something
} catch(exception e) {
foo();
}
}
When I saw this in production I cried a little...9 -
Sorry, but the app had to stay running. It was just a minor exception anyway.
try {
executeMainLoop();
}
catch (Exception ex) {
executeMainLoop();
}4 -
Android development is such an enormous realm. It's simply incredible.
Even after more than 2 years of programming android apps, I can experience a different exception every day!8 -
I don’t know what’s worse:
1) The dev that whitelisted .jpg and throws an exception when .jpeg is used.
2) I’m having to educate business users how to rename a file.5 -
That moment of joy when u see an exception error on the screen instead of a white page
Getting there😂5 -
Applying to a school for CS major, and they can't even fix their website to not have a null pointer exception...
Do I really want to go here?13 -
import java.util.Exception;
try {
public class A {
public static void main(String args[]) {
new Exception();
}
}
}
catch(Exception e) {
System.out.println("Got you BITCH");
}9 -
I believe that sometimes my IDE should tell me : FuckingRetardException : Man, wtf are you doing. Go fuck yourself
😂😂😂1 -
Python be like
"During handling of the above exception, another exception occurred" ... Exception : exception not defined.
Well fuck you too goddammit5 -
What's the worst thing you can say to a programmer parent?
"You've not raised kids.. you've raised exceptions"1 -
Google Duplex: "Hi! Uhm.. I'd like to make a dinner reservation for 3."
Restaurant: "Sure! What time would you like?"
Google Duplex: "It's, uhh.. for tomorrow May the 11th at NULL POINTER EXCEPTION."
Restaurant: "Internal Exception: Invalid parameter not satisfying: time"
Btw, hi devRant, this is my first post!!4 -
try {
// code that will someday
// throw an exception. Today is
// not that day.
}
catch(Exception ex) {
// The big day has arrived! BUT...
// I'm a heartless bastard who
// does not log errors.
// Good luck finding me!
}2 -
The title doesn't promise too much: eclipse indeed has multiple problems. I've never seen this kind of "nested exception" before :-D4
-
I'd like to see a horror movie called "Exception", where the main character experiences exceptions which should not happen according to the code's logic.11
-
public String getDbPasswd(){
try{
String dbPasswd = SomeInhouseEncryptionLib.getPasswd("/hard/coded/path/to/key");
return dbPasswd;
} catch(Exception e){
LOGGER.log(Level.SEVERE,e)
return "the-actual-password";
}
return null;
}
And this is now in production
FML3 -
spent an hour trying to fix an error, in the end realized there was an error in the error message #facepalm1
-
The most helpful error message of all time:
Unhandled exception in line 0: Script error.
Literally translates to: “Something went wrong but I’m not gonna tell you what.” -
Found this gem in some old piece of code:
public static void printStackTrace(Exception e){
e.printStackTrace();
}3 -
If a program says that an unknown error occurred. It probably means, that the programmer was too lazy to handle an exception.3
-
I am going to create a new language called Yoda that is identical to Java but it has no exception handling and no for loops.6
-
Fatal Exception: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available4
-
Best way to handle any exception...
try{
something
} catch(e) {
window.location.href =
"http://stackoverflow.com/search/...]+"
+ e.message;
}joke/meme coding c++ tip of the day tricks stack overflow random rant try catch joke but will be useful 😂😂😂 programmer hacks8 -
I heard scary thing.
A tester found an issue yesterday. He came to the dev and reported about it. Apparently the only feedback message was "something went wrong". They spend almost an hour hunting down the cause for that. It turned out the error message was from one of the try-catch. I do not know much details apart from that. At the end, the dev lead said this (which he had said before).
"That's why I don't like to catch exception."10 -
Junior: I don't think the methodology you came up with is working.
Me: Why?
Junior: There's an exception when I ran it
Me: ...what exception
Junior: FileNotFoundError
Me: ......have you checked if the path to the file is correct?
Junior: No
(A few moments later)
Junior: Oh I forgot to decompress the zip. Nevermind.9 -
When you test your backend code thoroughly before pushing to production, but a fatal exception with the much larger production userbase causes one of your vital threads to die with a NullPointerException.6
-
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 -
The intern: FUUUUCK, WHY ISN'T MY CODE WORKING?
Me: Lemme check real quick... ok, that's a null pointer exception.
The intern: Again? Man, I'm growing desperate. How do I stop making these errors?
My dumb ass with my 4 years coding experience, who encountered a nullpointerexception literally 5 minutes earlier: """"°-°""""11 -
Exception handling: when you really like a cute girl and are about to ask her out. Still you kinda also chit chat with her slighly less cute friend in case something goes wrong.2
-
Dear Zoom,
STOP FUCKING TAKING OVER THE DAMN WINDOW FOCUS WHEN SOMEBODY SHARES THEIR SCREEN
P.S.: Even your own chat is no exception. That's just plain stupid21 -
Porting Java Code to Kotlin manually, just to get a better understanding of the language. Best thing so far, NO more Assertive Exception Handling.
Damnit Java, I know it for a fact that the damned thing won't throw an exception! There's Careful and Paranoid. KNOW THE DIFFERENCE5 -
By someone who reviewed my code. "Put a null check in the catch block for the exception....cuz some times exception itself might be null..."
And by that he/she means,
catch (Exception e){
if (e != null) {....}
}12 -
Here are few hillarious coding puns I found....
class Brick implements Throwable { }
byte me;
char acter;
float stone;
Exception taken;
string me_along;
int elligence;5 -
Yes of course, my problem is not having enough memory to throw an exception of not enough memory ...5
-
Pokemon exception handling is now my favourite antipattern. I can't believe I've never heard of it until today. I laughed way to hard in that lecture.5
-
11:59 -> why am i getting an invalid operation exception?
12:00 -> ...
12:01 -> why are we the only species that can question reason?2 -
try {
// something
} catch (SomeException e) {
}
Swallowed Exception.. what the fuck is wrong with you?! And I see this shit in a lot of places in the code!7 -
God damnit!
i recently inspected the c# sourcecode of a webservice, our webservice develop references to.
As i discovered a particular function in it, my face went instantly pale.
This golden-hammer function consists of ~2000 lines of code.
In the first line there is "try {".
On the last lines is "catch (Exception e) { throw new SomethingWentWrongException ("special function"); }"
At least, he "tried" xD
I don't want to develop on that planet anymore...7 -
No. Just no. The null pointer exception didn't come from my DB, it came from your Java code, so go away and fix it.2
-
Actual production code:
try{
[code]
try{
[code]
}catch(Exception ex){
[code]
}
}catch(Exception ex){
[code]
}
Double blasphemy!2 -
Just saw this in a production app. There's a reason no other language implemented VB's OnErrorResumeNext, BECAUSE IT'S A F***ING TERRIBLE IDEA.
Catch (exception e)
{
//not really an issue
Continue;
}1 -
1. Learn to read and understand the errors and exception messages. While writing code you're going to be facing exceptions most of the time and the real cause of them is under a lot of generic error messages. That and a lot of patience and perseverance.
2. You're going to face clients and bosses that ask you to do a temporary "workaround" even though you know there is a best way to solve a problem even if it takes more time and effort. Don't "crash" against their ideas, try to find a mid-term between the fast and easy work around and the best solution and leave it open to improve it in the future. I have met a lot of developers that let the frustration stops them to be creative just because the approved development is not what they wanted to do. -
try {
// something...
}
catch (Exception ex)
{
string uriToLaunch = "http://stackoverflow.com/search?q=" + ex.Message;
var uri = new Uri(uriToLaunch );
var success = await Windows.System.Launcher.LaunchUriAsync(uri );
}1 -
College: This is the debugging mode This is a breakpoint. Here you can see the variable values.
Work: print "asfadadadda" and variables and delete lines until it throws a different exception8 -
So, a friend of mine just got a NullPointerException from his shitty Java code, and decided to fix the problem by catching the exception.
Great fix bro, real smooth..1 -
try {
boolean isOk = meetTheGirl("Anna");
if (isOk) {
kiss();
goHomeAndProgram();
}
else {
cry();
goHomeAndProgram();
nextDay();
pickUpAGirl();
}
} catch (Exception e) {
//I don't know. My life is so empty
}7 -
Had an internet/network outage and the web site started logging thousands of errors and I see they purposely created a custom exception class just to avoid/get around our standard logging+data gathering (on SqlExceptions, we gather+log all the necessary details to Splunk so our DBAs can troubleshoot the problem).
If we didn't already know what the problem was, WTF would anyone do with 'There was a SQL exception, Query'? OK, what was the exception? A timeout? A syntax error? Value out of range? What was the target server? Which database? Our web developers live in a different world. I don't understand em.1 -
A friend of mine once buried an exception deep in some code that any reasonable programmer shouldn't ever come across that said "you're the worst person I know"
A few days later when a guy in our project was working on his awful patchwork of a database mapping he managed to somehow actually hit this exception. We all got a good laugh out of it! -
Do you have a "I don't write bugs" colleague? Put your language equivalent of this around their code and wait.
try:
# their code
except Exception:
print('lmao')4 -
🎶"You args the IO Exception,
You args the IO Exception,
You args the IO Exception,
You args the IO Exception"🎶
-The Only exception by Paramore -
Everything's working fine. Did:
"sudo composer update"
and now the api page says:
"Invalid Argument Exception"4 -
Worried about your application crashing? I have a fix. through the entire thing in a try/catch and catch Exception. 😁😁2
-
Today I had an app throw an out of memory exception, while trying to throw an out of memory exception1
-
I spammed a colleagues email to test my exception handling method, I didn't feel like using just my email.
My email to him: "muh bad"1 -
there's a special place for people who write empty catch blocks INTENTIONALLY ..
try{
... do something that may produce NPE;
} catch {Exception fuckYou){
// go die in a fire
}3 -
During handling of the above exception, another exception occurred. I have to confirm I'm not in Inception.1
-
In 3rd year of college my friend decided to get rid of all his NullPointerException by instantiating all his strings as "null"...2
-
When you spend forever debugging why your program is crashing and you forgot that you were originally testing that an exception should be thrown
😐1 -
Heard Java 7 provides catching multiple exceptions in single catch block ! hmm .. why need when I got this 😎😁
try {
// do something...
} catch (Exception e){
//log it ..
}6 -
When you're in a rush to write a new feature but your compiler keeps nagging about not handling exceptions2
-
//Something great
try
{
//Some code.
}
catch(Exception ex)
{
string url = "http://stackoverflow.com/search?q=";
System.Diagnostics.Process.Start($"{url}{ex.Message}");
}1 -
So I wrote an algo in python3 for a challenge in codechef.com but it raised this exception !
If I put the input() built-in method in a try/catch , how do i know what the input was in order to pass the test case?3 -
Important rule of programming: don't swallow exception and provide details for troubleshooting.
Visual Studio: The project file contains a property value that is not valid.8 -
Vodafone India is so shit omfg
Run npm install, ERROR json parse error due to ssl exception
Run pip install, again ssl exception
Run gradle build, again ssl exception!!!
Now everytime i gotta make a new project or install a dependency in anything, i have to pray to the blood god that cache contains a valid/uncorrupted package dependency or else ill have to nuke cache and borrow internet from someone else.
Once i port it to some other operator, i am gonna incinerate this mf sim.12 -
Null Pointer Exception
Null Pointer Exception,
you're in a class of your own.
I will try and catch you,
each instance you're thrown.
Null objects expel you,
because you are vile.
I dread that I'll c you,
when I attempt to compile.
Like the grim reaper,
you destroy lines of code.
And so to you,
I dedicate this ode.
You have no remorse
for those who won't test.
As a result,
I need to confess.
From time to time,
when there's no time waste.
I must rely
on cut and on paste.
Although we're acquainted,
I really must mention.
You're not my friend,
Null Pointer Exception. -
This happened today... Not my finest hour...
$.ajax({
url: "someurl",
type: "GET",
success: function(data) {
//do something
},
error: function() {
console.log(error);
}
});
...
Browser Exception:
Error: "error" is not defined
FML1 -
When updating + restarting your Windows PC fixes the random exception being thrown in your controller when you were worried your frontend code broke the site. 😲
-
Just realized my code was working fine the whole time after spending 5 hours debugging. Turns out I accidentally made it throw an exception at the wrong place .-.
-
You know what I had to deal with
A bunch of these shit
try{
//Shitty cluster fuck excuse for java
//code
}catch(Exception e){
}1 -
The moment you see this in your log:
Caused by: java.lang.NumberFormatException: Invalid float: "Pink"1 -
I'm having such a bad day, that an exception object passed on to my catch block itself caused a NullPointerException.1
-
my C# dream:
if (Object.Property != null)
wouldn't produce an exception if the obejct is null but just equal to false5 -
Found this gem in my news feed yesterday and can't get it off my mind: catch exception, sleep, goto try-block and, well, try again:
$attempts = 0;
start:
try {
$attempts++;
// (...)
} catch (Exception $e) {
if ($attempts <= 10) {
usleep(100000);
goto start;
)
}
Did we go full-circle? Is "goto" the next big thing? Is this a late april fools joke? What am I missing here? This can't be real.
Source: https://blog.frankdejonge.nl/back-t...4 -
I think somewhere i read a quote from Gary Kasparov on his view on Chess.
He said that after certain point of mastering it, it becomes too much mental pain.
I think the same can be said about programming.
Devs really enjoy it, but sometimes, damn that Null pointer exception.rant programming semicolon ; java log devs errors python arrayoutofindex null pointer exception joke1 -
Got anymore runtime exception handlers with that?
When a paid service that promises a million connection types can't even do an initial sync 🤦♂️. Back to bash scripting it is... -
I remember I couldn't compile a clean Xamarin Forms project on Visual Studio because of a System.TimeZoneInfoNotFoundException. The workaround?, changed my time zone to Central time USA-Canada. So apparently it is not allowed to use Xamarin in the third world...1
-
I LOST FAITH IN HUMANITY!
searched vim on ddg, found porn. Fuck me.
Looks like there’s no exception to the “3 letters rule”5 -
#cursee&productivity
Working from home again 🕺
By no means slacking. I'm legit working. With the exception of petting my dogs every now and then.4 -
When you testing your exception handling by throwing an exception, but the code throwing the exception has a bug and throws an exception, so you think it works... d'oh
-
If there's one thing I'd gladly kill with fire, then pass it over a steamy steamroller, then burn it a tank of hot fluoroantimonic acid, is every fucking Java library that returns null instead of throwing a meaningful exception.
Is it really that difficult for you to throw an exception anyway, then let ME figure out if I can ignore it or not?
Thanks to you, now I have to do super messy reflection things just to figure why did you return a null.
I'm not your fucking psychologist trying to pull your inner secrets. But I have to be, for the sake of stability of my app. Which already has its own mess of problems on its own.7 -
I just bumped into a javascript problem that exceeds the stupidity of previous ones:
Because promises can be retained after they settle, and handlers attached thereafter are pushed on the microtask queue, a promise rejection can't be asserted to be unhandled until the promise in question is GC'd.
Of course this is nuts so engines will conclude that a promise rejection is unhandled if there are no handlers at the moment of rejection.
I hate this language.10 -
Who the hell designed the fucking Java exception system? The fucking checked/unchecked exceptions is a big piece of crap.
Makes everything more complicatedly unnecessarily3 -
Coaches know: it's all about the mindset!
Runtime exception? Mindset!
No video in Teams? Mindeset!
Money got stolen? Mindset!1 -
I had perfect code until the exception handling was on my Todo list... Fuck my beautiful architecture I guess6
-
In a call from customer support to SRE:
"...is it possible to reboot the whole server with the exception of an instance?"1 -
I have had it with this motherflipping NullPointerExceptions, on my motherflipping method. Catch you tomorrow Exception, you will not have the better of my sanity today.
-
FFS PHP. If I have a failing json_encode() because one of the items isn’t a string, WHY DON’T YOU RAISE AN EXCEPTION6
-
Yeah..finally some improvement.
my code is throwing Internal Server error exception now, two days back it was showing Unknown Exception.
Improving day by day.1 -
Me: "ok let's have a look at this code I have to review ..."
try
{
* Some random unreadable overcomplicated shit code *
}
catch (Exception e)
{
// Useful for debug
}
😓
In which God forsaken crazy alternative universe, a "catch all" block that swallows the exception and does nothing else is even slightly close to the concept of "useful for debug"3 -
throw new exception("There were not enough free threads in the ThreadPool to complete the operation.");
Brain == toast -
"hey, can you please help me out with this, it isn't working"
"What's it say?"
"I dunno, It's giving (not throwing) some exception/error" (no clear distinction between them)
Well, shit. Did NOT expect Java to do that in case of some undesirable flow in code! Stack trace, error message, what was happening when the exception (or actual error) occurred as inferred from logs... Nope.
Great! -
You know you need a new pc when android studio freezes after you app crashes when trying to print out the exception but Crashlytics is faster by sending you an email.
-
Function works() {
Try {
HorriblyDyingCode();
Return true;
} catch (Exception e) {
Return false;
}
} -
Write code ... test ... bug found ... solve ... retest ... works as charm ... going to commit the code ... last test ... 100 exception thrown
-
when my rant get more than 5 comments.
#out of memory exception#
just drop it, unfollow and let them comment.
😜5 -
Build Succeeded in 9.37s (3 seconds ago) ...
$ java -jar MyAwesomeAppWithALotOfExceptionHandling.jar
Exception in thread "main" java.lang.NullPointerException
at ...
at ...2 -
When you see a try/catch block where the catch simply throws the caught exception:
try { /*stuff*/ } catch (Exception e) { throw e }
*headdesk*4 -
When you catch an ArrayOutOfBounds exception and the catch statement throws an ArrayOutOfBounds exception...
Fail -
Argument exception message convention: is it better to specify what is allowed or what is not allowed? Eg: "value must be a positive integer" or "value can not be negative"?2
-
Spent 3 hours trying to debug why java threw null exception when user disconnects or connects to room id to chat. Guess where the fucking bug was24
-
That moment when a junior calls your bluff and you respond like sharrup what do you know? And play the experience card.
"Why is there a try/catch in the exception block?"1 -
When you're presenting your first ever real project to your boss and the presentation PC comes up with a "Unsupported major.minor version 52.0" Exception 😒
Thanks Java..2 -
public void today() throws Exception {
Car c = getPosessions().getCar();
c.wash();
c.wax();
Game g = getPosessions().getUnchartedFour();
while(!g.finished()) {
g.play();
Thread.sleep(1000);
}
this.eatDinnerWith(getFamily());
System.out.println("Today Rocked!");
}4 -
To all impatient Project Leaders: You should never, under any circumstances, change the release Date from Tuesday to Friday (before). Even spontaneous Holidays of the CEO is no exception.
-
What hurts you the most?
1. Breakup
2. IDE with White Background
3. HTTPS://DUCKDUCKGO.COM (Caps Url)
4. Download failed at 99%
5. NULL Pointer Exception
🤔🤔🤔29 -
There is normal to have an unexpected exception in a life.
If you learn to code, you know thats why there is try/catch exist, so when you try something and there is an exception you know how to pass it.
Why? So whenever something goes unexpected from your expectation you already have an exception for it and just pass it rather than making your entire mind crashing!24 -
Angular2: Error: Unhandled exception, cannot read property "classList" of null
Me: element = doucment.getElementById("nameOfObject")
Angular2: Error: Unhandled exception, cannot read property "classList" of null
Me: DoWhatIWant();
Angular2: Success!1 -
Got a call about production was going to fail. They thought it's the application server.
I'm the end it was bogus file mods which were scrambled by the backup tool.
Why we didn't find out earlier? Because the java application was coded like this:
-------
String content;
Try {
File bla = new File
content = ... Read operation
} catch (IoException | SecurityEx | RuntimeEx ex)
// nothing we can do here
}
doWork(content);
---------
Why the fuck do we have code reviews? Why not just log or throw a Runtime Exception? Argh... I thought it would be better in enterprise applications. Perhaps I should tell them to not just use pmd, also spotbugs and sonarqube. But the department for the build tools does not have enough employees. Dang.
Anyway. Earned some money for that.
Now it's 2018 and I still get money for the same kind of bugs as 2008.3 -
"You're one hell of an exception I would like to try & catch"
What's your programmer pick up lines?3 -
Something you really should not do:
*adds a new feature*
*build & run*
*See no difference*
Me: "Hmm.. Maybe 1 is not the best test integer, let me pick something higher..."
*build & run*
*INTEGER OVERFLOW EXCEPTION*
Feel free to share your "let me choose anothee test integer"-stories, which gone terribly wrong.1 -
Java has the worst kind of union type where every method returns the union of Exception | null | value.17
-
((Human)me).initialize(new Activity().setActivity(new Project((AndroidApp)devrant_clone, new ProgrammingLanguage ("java"))));
Brace yourself java null pointer exception is already on its way. -
Saw this exception message in some code for one of my personal projects this morning. "Unable to join table(s) (" . implode( ' , ', array_keys( $this->tables_to_join ) ) . "). Please develop this shit better". How frustrated I must had been to have written that!
-
Ok so Sonar had a rule that you should not throw Exception. Rather you should always throw a specific types or catch them...
I don't understand this. So if the underlying function throws 10 different types of exceptions then the calling function should also declare it throws 10 different types rather than just Exception?
Assuming it isn't in a position to handle them?2 -
Thinking about a new annotation:
@JavaCondom
on function: it puts "... throws Exception " at the end
on class: reflection puts "... throws Exception" on every goddamn function
It could have global app property which makes appends every exception with a reassuring message like: "There is so much java code out there already, that this shit will never ever end"2 -
Stuck here with PHP doing his PHPices and just get to think about something really important... If two cats starts to fight is this a CATastrophe? Ok, better fix this amazing SQL exception.
-
How can a function cause a null pointer exception at runtime when it compiles perfectly and you haven't put it in use yet? Wtf.
-
Today is my day to clear the confusion between strong exception safety and basic exception safety. <3 c++
And I have to have do this. Long time.1 -
Looking at code from previous devs...which I now support...
Oh hey there is a function to retry connecting to the database if it fails to open...ok...
It doesn't return anything e.g. a boolean. Not a big deal I'll catch the exception...
It catches the exception and silently ignores it? WTF how do I know if it fails??
It keeps trying for 20 seconds...sounds reasonable...wonder how long it waits between failed attempts...0. No sleep, no back off, literally spams the open call as quick as it can throw the exception...
I'm glad I personally dont know them. They are fucking idiots. -
Spend two whole days solving an exception in a new feature, then the client decides that the old version is the way to go..1
-
"Object reference not set to a reference of an object" is the single least helpful exception ever.
Also, I still hate Visual Studio. Sorry.9 -
when you got an exception on store and you've tried it like a million times and it didn't happen, and you just give up and "try catch" that motherfucker!
-
The biggest problem with error reporting is that devrant closes android exception form before I can actually send that data...1
-
So here I am debugging a factory in an algorithm I didn't write in a library I didn't write all so I can jam an exception throw into the code to handle input validation.
I am being forced to use exception handling. To handle input validation.
What is my life? It wasn't supposed to be this way. I was supposed to work with smart people who do smart things. Why? -
One of the worst practices in programming is misusing exceptions to send messages.
This from the node manual for example:
> fsPromises.access(path[, mode])
> fsPromises.access('/etc/passwd', fs.constants.R_OK | fs.constants.W_OK)
> .then(() => console.log('can access'))
> .catch(() => console.error('cannot access'));
I keep seeing people doing this and it's exceptionally bad API design, excusing the pun.
This spec makes assumptions that not being able to access something is an error condition.
This is a mistaken assumption. It should return either true or false unless a genuine IO exception occurred.
It's using an exception to return a result. This is commonly seen with booleans and things that may or may not exist (using an exception instead of null or undefined).
If it returned a boolean then it would be up to me whether or not to throw an exception. They could also add a wrapper such as requireAccess for consistent error exceptions.
If I want to check that a file isn't accessible, for example for security then I need to wrap what would be a simple if statement with try catch all over the place. If I turn on my debugger and try to track any throw exception then they are false positives everywhere.
If I want to check ten files and only fail if none of them are accessible then again this function isn't suited.
I see this everywhere although it coming from a major library is a bit sad.
This may be because the underlying libraries are C which is a bit funky with error handling, there's at least a reason to sometimes squash errors and results together (IE, optimisation). I suspect the exception is being used because under the hood error codes are also used and it's trying to use throwing an exception to give the different codes but doesn't exist and bad permissions might not be an error condition or one requiring an exception.
Yet this is still the bane of my existence. Bad error handling everywhere including the other way around (things that should always be errors being warnings), in legacy code it's horrendous.6 -
Saw another post about a receipt with an exception and it reminded me of this...
"Yes, I'm sitting at Table 0" -
!rant
Go's tuple-style returns. ❤️
What's an exception? I don't even know what those are anymore. 😄
I've started using this pattern in JavaScript / TypeScript too.
also... supabase anyone? ❤️5 -
Everytime anywhere any programming language, the example for exception handling is always
a/0;
Why god why??1 -
when the stack trace wasn't included in the error logging
fuck me, how the fuck am i supposed to know where the exception occurred
perhaps i've taken it all for granted thinking that the default toString implementation of an exception would've included that5 -
I really cannot see why there still isn't an API in Java where I can get an hashing algorithm without having to catch a checked exception.
Granted, Bouncy castle is a top library. But of you just have a small application with a single method wanting to hash a few values... It's so nuts and unnecessary.
So what do you do in the catch block? Either throw a checked exception (because without that hash your app won't work), or calculate a replacement. But if it were that easy, I wouldn't have needed a hash on the first place.
I really wonder what the java developers had in mind.
Same with IO exception. I'm beginning to like python more and more.
And, of course, kotlin.5 -
VS Exception Display is full badfor me now.
I had a query problem in my code, and the only exception displayed by VS was one that don't help that much.
But there were two exceptions messages to display. Fortunatly the front-page displayed the full stack, else I'd have no clue of what was going on. -
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 26
at words.main(nightmare.java: 4)1 -
`Holy shit never turn on caught exception breakpoints in vs code for node !
and the one place i need the damn code to break, it doesn't break !1 -
The power to make clients trust my code.
It's a vicious circle; I code, client doesn't trust my code, I make changes as a result which break the code and.... Stack overflow exception -
Framework throwing null reference exception, support is in another timezone and the client needs a fix before close of business. Guess it's time to get out the decompiler.
-
without exception - everyone I know who writes code and thinks ChatGPT is overhyped - thinks 3.5 is what ChatGPT is.
literally like concluding “aws is overhyped” bc free tier sucks.15 -
QA raised several issues. I updated the code, now he’s struggling to reproduce those. Exceptions are working as expected! 😁2
-
There is no something more frustrating than that when you write a long code in java, and you click the debug button and that happens:
Null Pointer Exception -
I get a simple exception because of a connection reset, can't catch it becouse it "happens in external code" urgh, fuck you .net core..
-
Why is it perfectly acceptable to not put Exception information in documentation?
I know we're supposed to test our code and Exception types are acquired that way, but I really believe stating just a few common Exception types in documentation would cure the curse of;
>> except Exception as E:
Which is not much use to anyone.1 -
Some people were lazy so they added throws Exception to all the methods up till main. No catch clause....1
-
You know what's worse than getting an exception figuring out after wasting few hours, cleaning your project would solve it. Thank you Xcode ;(1
-
Question for any IT Techs here.
I'm getting an MAPI Exception Network Error when trying to migrate a Rehires email. Any solutions1 -
Have to deal with a code that is deployed in integration environments for testing
And someone decided that throwing an exception saying "OK" was a good idea -
I Encountered this exception in Flutter "Unhandled Exception: Unable to RTCPeerConnection::createAnswer: Error (null)"
Anyone who face this before ? I am so new to this.
https://stackoverflow.com/questions...2 -
What's harder than debugging an uncaught exception in a view
If only debuggers like vs can attach to the server side logic of the views