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.
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.
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.