Exception handling renew
MODIFY
WalletWasabi.Fluent/Models/WebcamQrReader.cs
WalletWasabi.Fluent/Models/WebcamQrReader.cs
@@ -51,9 +51,12 @@ namespace WalletWasabi.Fluent.Models
try
{
camera = new();
- if (!camera.Open(DefaultCameraId))
+ camera.SetExceptionMode(true);
+ // Setting VIdeoCaptureAPI to DirectShow, to remove warning logs,
+ // might need to be changed in the future for other operating systems
+ if (!camera.Open(DefaultCameraId, VideoCaptureAPIs.DSHOW))
{
- throw new InvalidOperationException("Could not open webcam.");
+ throw new InvalidOperationException("Could not open webcamera.");
}
RequestEnd = false;
KeepScan(camera);

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ShowQrCameraDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ShowQrCameraDialogViewModel.cs
@@ -51,7 +51,10 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
.Subscribe(async args =>
{
Close();
- await ShowErrorAsync(Title, args.EventArgs.Message, "Something went wrong");
+ await ShowErrorAsync(
+ Title,
+ string.IsNullOrWhiteSpace(args.EventArgs.Message) ? "Could not read frames. Please make sure no other program uses yor camera." : args.EventArgs.Message,
+ "Something went wrong");
});
}

Exception handling renew