Attempts to obtain the message from a possible error object, defaulting to an empty string if it is impossible to do so.
The message if error is an object with a message property; the string version of error if it is not undefined or null; otherwise an empty string.
error
message
undefined
null
The possible error to get the message from.
Attempts to obtain the message from a possible error object, defaulting to an empty string if it is impossible to do so.
Returns
The message if
error
is an object with amessage
property; the string version oferror
if it is notundefined
ornull
; otherwise an empty string.