CC#
Created by Shadow Wizard Money Gang on 4/29/2025 in #help
Why doesn't this try catch, catch exception.
I have these two methods, in register I have a try catch but it's not catching the exception thrown in the try block. I'm doing something wrong but I cannot figure it out. isEmailUsed is definitely true.
public async Task RegisterUser(UserRegistrationDTO userToRegister)
{
// await _userRepository.CreateUserAsync(userToRegister);


bool isEmailUsed = await _userRepository.IsEmailUsedPreviously(userToRegister.Email!);
if (isEmailUsed)
{
throw new Exception("Email is already in use");
} else
{
//create user
await _userRepository.CreateUserAsync(userToRegister);
}

}
public async Task RegisterUser(UserRegistrationDTO userToRegister)
{
// await _userRepository.CreateUserAsync(userToRegister);


bool isEmailUsed = await _userRepository.IsEmailUsedPreviously(userToRegister.Email!);
if (isEmailUsed)
{
throw new Exception("Email is already in use");
} else
{
//create user
await _userRepository.CreateUserAsync(userToRegister);
}

}
[HttpPost("register")]
public ActionResult<UserRegistrationDTO> Register(UserRegistrationDTO request)
{
var validationResult = _userRegisterValidator.Validate(request);

if (!validationResult.IsValid)
{
var problemDetails = new HttpValidationProblemDetails(validationResult.ToDictionary())
{
Status = StatusCodes.Status422UnprocessableEntity,
Title = "Validation failed",
Detail = "One or more validation errors occured",
Instance = "api/register"
};

return UnprocessableEntity(problemDetails);
}

try
{
_authService.RegisterUser(request);
}
catch (Exception ex)
{
return Conflict(ex.Message);
}


return Created();

}
[HttpPost("register")]
public ActionResult<UserRegistrationDTO> Register(UserRegistrationDTO request)
{
var validationResult = _userRegisterValidator.Validate(request);

if (!validationResult.IsValid)
{
var problemDetails = new HttpValidationProblemDetails(validationResult.ToDictionary())
{
Status = StatusCodes.Status422UnprocessableEntity,
Title = "Validation failed",
Detail = "One or more validation errors occured",
Instance = "api/register"
};

return UnprocessableEntity(problemDetails);
}

try
{
_authService.RegisterUser(request);
}
catch (Exception ex)
{
return Conflict(ex.Message);
}


return Created();

}
6 replies
CC#
Created by Merineth 🇸🇪 on 4/29/2025 in #help
Chess Game with WPF in Visual Studio + MVVM
No description
3 replies
BABetter Auth
Created by Glen Kurio on 4/29/2025 in #help
useSession returns null for data in Next.js
Client side useSession form Better-Auth Client returns null:
const { data, error, refetch, isPending } = useSession();
console.log("SESSION DATA: ", data);
// logs SESSION DATA: null
const { data, error, refetch, isPending } = useSession();
console.log("SESSION DATA: ", data);
// logs SESSION DATA: null
Have no idea why. Can someone help me to figure it out? Does anyone had such issue?
9 replies
UBUniversal Blue
Created by larvs on 4/29/2025 in #🛟bazzite-help
Upgrading hardware, want to confirm I am doing things right.
Ive purchased some parts to upgrade my PC, namely the GPU which was a Arc B580 12GB. i went for this as I want to try the new Battlemage cards, and my current RX 6600 8GB card is showing its age a bit. Is there anything I need to do before I swap the cards out? To my understanding, the Arc cards use the MESA drivers like the AMD cards do, just want to confirm this is correct or if I am barking up the wrong tree. Is there anything I should do for good measure to make sure it goes smoothly? Nothing else is changing other than some changes to my cooling and a new case. Main ones the GPU. Thank you all!
17 replies
UBUniversal Blue
Created by BarkBark🐾 on 4/29/2025 in #🛟bazzite-help
bazzite-nvidia-open freeze when changing Night light temperature
No description
2 replies
UBUniversal Blue
Created by ノイム尺の on 4/29/2025 in #🛟bazzite-help
how i can install packages
i wanna install gparted but bazzite is blocking me from doing that
6 replies
PMPUBG MOBILE
Created by Rafin on 4/29/2025 in #questions
How to unban my account
i have reinstall gameloop emulator and played some match in pubg mobile. but igot ban in morning . i never used any third-party software, cheats, or violated the game’s rules but i got ban.
3 replies
GGermanSimRacing
Created by Kampfkartoffel40 on 4/29/2025 in #hardware-fragen
Gute Sim Racing Handschuhe Für unter 50 Euro?
Hey kann jemand gute handschuhe fürs simracing für unter 50 euro empfehlen?
5 replies
SMSatisfactory Modding
Created by Red on 4/29/2025 in #help-using-mods
Screw it
Using Screw it by Rex for 1.0 but when it loads every icon shows as a screw?
7 replies
XXata
Created by Michael Schaufelberger on 4/29/2025 in #help
Is there a way to move files between branches?
Hi 👋 I was wondering if there's a way to move/copy over files when moving data from one branch/db to another. AFAIK, I think the only way is to run a script which downloads from the source records and re-uploads to the target column. Is there a better way?
2 replies
RRCRat Rig Community [Unofficial]
Created by Hercules_119 on 4/29/2025 in #fix-my-printer
Upper belt binding.
My printer has been working perfectly fine. All of a sudden I notice a layer shift so I move the tool head around and notice excessive force to move the upper belt. I checked the set screw on the motor and they’re screwed all the way. Is there anything else that could cause the upper belt to bind?
8 replies
PMPUBG MOBILE
Created by memo_17 on 4/29/2025 in #questions
I need help with microphone ban Fast
Hello, I have been playing this game for a long time and I have kept quiet until now. When I was banned for swearing, I said okay, but if people swear in the park without swearing and do not get banned, it would be unfair. I get banned without swearing, they do not get banned by swearing. If you want this game to go to a better place, you can reply to this message.
3 replies
RRSM.GG
Created by COZMO on 4/29/2025 in #📞|support
??
No description
10 replies
RRCRat Rig Community [Unofficial]
Created by brian on 4/29/2025 in #ratos-support
temperature_MCU toolhead
Trying to work up a custom toolhead cooling setup for my EBB42. Problem is that when I try to set up a temperature fan for the toolboard MCU, I get the pin ADC used multiple times error, because the toolboard MCU it is already listed in the RATOS.cfg for temperature monitoring. If I delete the temperature_MCU monitoring lines in RATOS.cfg, it works. Is there a known or feasible workaround for this?
6 replies