ProgrammerHumor

yepThatsMe

yepThatsMe
https://i.redd.it/t16gqvuc4lcf1.png
Reddit

Discussion

No-Article-Particle

What are you doing indeed...

9 hours ago
Boris-Lip

Next compiler/framework/<insert whatever throws this shit here> update they change the message and this thing breaks. But you already know that, yet still doing it...

10 hours ago
adiXjinx OP

i seriously don't know what to do, like what can i do ?

10 hours ago
Boris-Lip

Is it a separate exception type? Catch a specific type then. Is there an error code instead of a message? Check against that error code. Etc.

10 hours ago
adiXjinx OP

waait!! wtf am i doing, username can't be updatable why tf i build that ahhh this whole time šŸ˜­ļø

10 hours ago
gorilla60rilla

lol this put a smile on my face, no hard feeling tho, just fun, I see myself in you. We should talk more with our duck bro

9 hours ago
adiXjinx OP

i don't have duck !!

6 hours ago
reginakinhi

That's the problem right there

3 hours ago
[deleted]

[deleted]

5 hours ago
Cyberuben

This would still have the possibility of race conditions, where you check, it’s available, another transaction commits, and now it’s not valid. Handling the unique constraint error the same as the pre-check should cover enough

5 hours ago
gameplayer55055

I usually do select 1 from tblUsers where username = @name

It still may not be the best method, so I rate limited auth just in case cool haxor decides to rape my db

If you're scared of race conditions, make an SP with a transaction for auth.

2 hours ago
Ronin-s_Spirit
:js:

r/programmerhorror you mean.

4 hours ago
adiXjinx OP

ohhh sorry i uploded it at wrong place

3 hours ago
om_nama_shiva_31

Worst bait ever

2 hours ago
rover_G
:c::rust::ts::py::r::spring:

Surely the error has a type and/or code that specifies the exact issue? Or maybe you can check the database for duplicate usernames?

1 hour ago
ZeroDayCipher

Idk wtf is going on here but dam I want to at least throw the error check into its own variable so your if statement isn’t staggered across multiple lines. My god….

1 hour ago
adiXjinx OP

CodeRabbit

Fix typo in filename: "createResponce.ts" should be "createResponse.ts".

yess sure why not change every fuking file for a "s" ??

10 hours ago
kimochiiii_

don't you have some IDE that'll do it for you?

7 hours ago
adiXjinx OP

yeh i did it

6 hours ago