[ovirt-devel] WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'

Martin Mucha mmucha at redhat.com
Fri Feb 20 16:07:08 UTC 2015


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 at redhat.com>
> > To: "Greg Sheremeta" <gshereme at redhat.com>
> > Cc: devel at 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 at redhat.com>
> > To: devel at 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 at redhat.com
> > 
> > _______________________________________________
> > Devel mailing list
> > Devel at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/devel
> > 
> _______________________________________________
> Devel mailing list
> Devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/devel
> 



More information about the Devel mailing list