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...
i seriously don't know what to do, like what can i do ?
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.
waait!! wtf am i doing, username can't be updatable why tf i build that ahhh this whole time šļø
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
i don't have duck !!
That's the problem right there
[deleted]
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
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.
ohhh sorry i uploded it at wrong place
Worst bait ever
Surely the error has a type and/or code that specifies the exact issue? Or maybe you can check the database for duplicate usernames?
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ā¦.
CodeRabbit
Fix typo in filename: "createResponce.ts" should be "createResponse.ts".
yess sure why not change every fuking file for a "s" ??
don't you have some IDE that'll do it for you?
yeh i did it
What are you doing indeed...