Access to low level severity messages

If I run:

Graphics3D[ { Red, Sphere[] } ]
MessageList[$Line - 1]

the output is {} as no message has been generated when producing the graphic.

Now, if I run:

Graphics3D[ { red, Sphere[] } ]
MessageList[$Line - 1]

the ouput is still {}, although on the console the message: “red is not a Graphics3D primitive or directive.” has been correctly generated when producing the incorrect graphic.

How to get access to this message, or at least know that a low level message has been generated to take proper action?

Thanks.

These messages do not appear in MessageList since they aren’t generated by the kernel, but by the front end rendering. To access them, try

MathLink`CallFrontEnd[FrontEnd`GetErrorsInSelectionPacket[EvaluationNotebook[]]]

Yes,

that does it. I have to learn how to manipulate this list!

Thanks,

A.