WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'

This warning message of $subject is spamming Firebug / Dev tools consoles on latest master. VM tab > Display column is at least one source of it. EnumTranslator is getting nulls passed to translate(). I'm not sure why it's logging about it all of a sudden. Anyone recognize this? Greg Sheremeta Red Hat, Inc. Sr. Software Engineer, RHEV Cell: 919-807-1086 gshereme@redhat.com

Yeah, I think I was the last who touched that code. IIRC null is passed when a VM doesn't have active graphics (e.g. Down state). I'll take a closer look. Cheers, F. ----- Original Message ----- From: "Greg Sheremeta" <gshereme@redhat.com> To: devel@ovirt.org Sent: Friday, February 20, 2015 2:31:43 AM Subject: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A' This warning message of $subject is spamming Firebug / Dev tools consoles on latest master. VM tab > Display column is at least one source of it. EnumTranslator is getting nulls passed to translate(). I'm not sure why it's logging about it all of a sudden. Anyone recognize this? Greg Sheremeta Red Hat, Inc. Sr. Software Engineer, RHEV Cell: 919-807-1086 gshereme@redhat.com _______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

That's correct. I think we can just remove the warning. Returning "N/A" seems like a fine behavior to me. Greg ----- Original Message -----
From: "Frantisek Kobzik" <fkobzik@redhat.com> To: "Greg Sheremeta" <gshereme@redhat.com> Cc: devel@ovirt.org Sent: Friday, February 20, 2015 10:33:43 AM Subject: Re: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
Yeah,
I think I was the last who touched that code. IIRC null is passed when a VM doesn't have active graphics (e.g. Down state). I'll take a closer look.
Cheers, F.
----- Original Message ----- From: "Greg Sheremeta" <gshereme@redhat.com> To: devel@ovirt.org Sent: Friday, February 20, 2015 2:31:43 AM Subject: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
This warning message of $subject is spamming Firebug / Dev tools consoles on latest master.
VM tab > Display column is at least one source of it.
EnumTranslator is getting nulls passed to translate(). I'm not sure why it's logging about it all of a sudden.
Anyone recognize this?
Greg Sheremeta Red Hat, Inc. Sr. Software Engineer, RHEV Cell: 919-807-1086 gshereme@redhat.com
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

No, that warning was created by me, when altering EnumTranslator to remove few problems of it. we 'can' just remove the warning, but I do think that trying to localize null key is just wrong since we're not able to differentiate misuse, lets say when providing key from variable, and proper localization of null value. Thus, can somebody explain, why it's valid to trying localize null valued enum type? If there's need to localize null key, I'd rather opt for having special method for that to explicitly show programmers intention. But for me it seems as a call for new properly named enum value. sorry about any complications with this. M. ----- Original Message -----
That's correct.
I think we can just remove the warning. Returning "N/A" seems like a fine behavior to me.
Greg
----- Original Message -----
From: "Frantisek Kobzik" <fkobzik@redhat.com> To: "Greg Sheremeta" <gshereme@redhat.com> Cc: devel@ovirt.org Sent: Friday, February 20, 2015 10:33:43 AM Subject: Re: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
Yeah,
I think I was the last who touched that code. IIRC null is passed when a VM doesn't have active graphics (e.g. Down state). I'll take a closer look.
Cheers, F.
----- Original Message ----- From: "Greg Sheremeta" <gshereme@redhat.com> To: devel@ovirt.org Sent: Friday, February 20, 2015 2:31:43 AM Subject: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
This warning message of $subject is spamming Firebug / Dev tools consoles on latest master.
VM tab > Display column is at least one source of it.
EnumTranslator is getting nulls passed to translate(). I'm not sure why it's logging about it all of a sudden.
Anyone recognize this?
Greg Sheremeta Red Hat, Inc. Sr. Software Engineer, RHEV Cell: 919-807-1086 gshereme@redhat.com
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

patch: http://gerrit.ovirt.org/#/c/38007/ Greg ----- Original Message -----
From: "Martin Mucha" <mmucha@redhat.com> To: "Greg Sheremeta" <gshereme@redhat.com> Cc: "Frantisek Kobzik" <fkobzik@redhat.com>, devel@ovirt.org Sent: Friday, February 20, 2015 11:07:08 AM Subject: Re: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
No, that warning was created by me, when altering EnumTranslator to remove few problems of it.
we 'can' just remove the warning, but I do think that trying to localize null key is just wrong since we're not able to differentiate misuse, lets say when providing key from variable, and proper localization of null value. Thus, can somebody explain, why it's valid to trying localize null valued enum type? If there's need to localize null key, I'd rather opt for having special method for that to explicitly show programmers intention. But for me it seems as a call for new properly named enum value.
sorry about any complications with this.
M.
----- Original Message -----
That's correct.
I think we can just remove the warning. Returning "N/A" seems like a fine behavior to me.
Greg
----- Original Message -----
From: "Frantisek Kobzik" <fkobzik@redhat.com> To: "Greg Sheremeta" <gshereme@redhat.com> Cc: devel@ovirt.org Sent: Friday, February 20, 2015 10:33:43 AM Subject: Re: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
Yeah,
I think I was the last who touched that code. IIRC null is passed when a VM doesn't have active graphics (e.g. Down state). I'll take a closer look.
Cheers, F.
----- Original Message ----- From: "Greg Sheremeta" <gshereme@redhat.com> To: devel@ovirt.org Sent: Friday, February 20, 2015 2:31:43 AM Subject: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
This warning message of $subject is spamming Firebug / Dev tools consoles on latest master.
VM tab > Display column is at least one source of it.
EnumTranslator is getting nulls passed to translate(). I'm not sure why it's logging about it all of a sudden.
Anyone recognize this?
Greg Sheremeta Red Hat, Inc. Sr. Software Engineer, RHEV Cell: 919-807-1086 gshereme@redhat.com
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

Hi guys, I see the problem here and I think cleanest solution would be either: - adding a new enum to represent 'none' state, or - displaying vm default graphics in that column and change it to runtime graphics when the vm is started. I'll think of the best solution and will try to post a patch soon. Thanks, Franta. ----- Original Message ----- From: "Martin Mucha" <mmucha@redhat.com> To: "Greg Sheremeta" <gshereme@redhat.com> Cc: "Frantisek Kobzik" <fkobzik@redhat.com>, devel@ovirt.org Sent: Friday, February 20, 2015 5:07:08 PM Subject: Re: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A' No, that warning was created by me, when altering EnumTranslator to remove few problems of it. we 'can' just remove the warning, but I do think that trying to localize null key is just wrong since we're not able to differentiate misuse, lets say when providing key from variable, and proper localization of null value. Thus, can somebody explain, why it's valid to trying localize null valued enum type? If there's need to localize null key, I'd rather opt for having special method for that to explicitly show programmers intention. But for me it seems as a call for new properly named enum value. sorry about any complications with this. M. ----- Original Message -----
That's correct.
I think we can just remove the warning. Returning "N/A" seems like a fine behavior to me.
Greg
----- Original Message -----
From: "Frantisek Kobzik" <fkobzik@redhat.com> To: "Greg Sheremeta" <gshereme@redhat.com> Cc: devel@ovirt.org Sent: Friday, February 20, 2015 10:33:43 AM Subject: Re: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
Yeah,
I think I was the last who touched that code. IIRC null is passed when a VM doesn't have active graphics (e.g. Down state). I'll take a closer look.
Cheers, F.
----- Original Message ----- From: "Greg Sheremeta" <gshereme@redhat.com> To: devel@ovirt.org Sent: Friday, February 20, 2015 2:31:43 AM Subject: [ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'
This warning message of $subject is spamming Firebug / Dev tools consoles on latest master.
VM tab > Display column is at least one source of it.
EnumTranslator is getting nulls passed to translate(). I'm not sure why it's logging about it all of a sudden.
Anyone recognize this?
Greg Sheremeta Red Hat, Inc. Sr. Software Engineer, RHEV Cell: 919-807-1086 gshereme@redhat.com
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
participants (3)
-
Frantisek Kobzik
-
Greg Sheremeta
-
Martin Mucha