Wish Disable certain warning logs

MathiasM

Active Member
Licensed User
Hello

It would be nice to have an option to disable some warning logs. Eg: I have a lot of warning #2, but that is because I make use of the ExceptionEx class when an object could not be returned from a method. But if fills up the list.

Thanks
 

MathiasM

Active Member
Licensed User
Hmh.

I tried it, but in some way, it doesn't work. See screenshot:
ZLjZyGG.png


I already tried restarting the IDE etc, no difference.
 

Cableguy

Expert
Licensed User
Longtime User
You can also try to add the comment 'ignore In front of the line (in line with it) that causes this warning
 

alwaysbusy

Expert
Licensed User
Longtime User
comment 'ignore In front of the line (in line with it)
I prefer to put it after the code line:

e.g.
[/code]
sub mySub() as String 'ignore
...
end sub
[/code]

Still, I think the #IgnoreWarnings should work. Maybe it doesn't for 2 as this is a rather severe thing and can cause all kind of craches. You should not ignore this warning and solve the problem.
 

MathiasM

Active Member
Licensed User
Thanks @Cableguy and @alwaysbusy, ignore works fine.

Still, I think the #IgnoreWarnings should work. Maybe it doesn't for 2 as this is a rather severe thing and can cause all kind of craches. You should not ignore this warning and solve the problem.

There is no problem per se. I code like this (a bit out of context, but you will get the idea):

B4X:
Public Sub getUserByUsername(username As String) As User
   Dim u As User = dbCore.GetObjectByUniqueColumnValue("users", "username", username)
   If u.IsInitialized Then
       Return u
   Else
       Dim ex As ExceptionEx
       ex.Initialize("User not found")
       ex.Throw
   End If
End Sub

I could also return Null, but I prefer Exceptions.
 
Last edited:
Top