Open xxandev opened 1 year ago
https://github.com/fyne-io/fyne/issues/4033#issuecomment-1652726057
I'm aware of this solution, but I would like to have the ability to handle errors.
Adding errors to the mentioned APIs would be a breaking change and I’m also not sure how useful it would be. Errors there occur very rarely and if you get one of the failures there, there is not much you can do from the binary to correct it. The user basically has to install the right drivers (if they exist) or enable 3D acceleration if running in a virtual machine.
You might be able to use recover()
to catch the panic but I can’t guarantee anything.
I don't mean recovering the user interface functionality. I want to perform a series of actions in case such an issue arises:
I was considering using recover(), but it doesn't seem to be the optimal approach, and I'm not sure it will work, as recover() needs to be called with defer in the function that invokes panic.
Perhaps, in order to avoid altering the current API since the changes are indeed critical, you could add a variable to the class that contains a function OnFatal or OnPanic, and invoke it in similar situations. This way, the API remains unchanged and users have the option to handle such issues independently.
You can download a opengl.dll newer, and put it in your application installation directory
Checklist
Is your feature request related to a problem?
APIUnavailable: WGL: The driver does not appear to support OpenGL
Hello, please advise on how to handle errors without modifying the library? The methods func (fyne.Window).ShowAndRun(), func (fyne.App).Run(), func (fyne.Driver).Run() do not return errors; they handle them internally within the methods. In case the user interface fails to launch, it is necessary to perform a series of actions before terminating the program.
Is it possible to construct a solution with the existing API?
No response
Describe the solution you'd like to see.
In my opinion, it would be very convenient to have the ability to handle errors.