[Gambas-user] Error.Raise an error with a code other than -1
benoit.minisini at gambas-basic.org
Thu Jun 9 12:59:29 CEST 2022
Le 09/06/2022 à 12:47, Bruce Steers a écrit :
> Something like this would be handy Ben...
> There I simply added a new method to Error class.
> Error.RaiseCode(sMsg As String, iCode As Integer)
> Works the same as Error.Raise(sMsg As String) but also sets a code other
> than -1.
> I was just playing with a bit of c
> But in all seriousness the Error.Raise() method would be extra useful if
> you can have an optional code parameter to set a value other than just
> the -1 Error.Raise() gives at present.
> using a code could make for better handling in the Catch.
> Unless it's already possible to set an error code?
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
At the moment it's not really possible.
I have the project to create a true non-global error object so that we
Print <variable>.Text;; <variable>.Code
If I succeed, it will be possible to add some user property to this
object (a tag for example), so that you can add your own information to
More information about the User