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
erroris an object with amessageproperty; the string version oferrorif it is notundefinedornull; otherwise an empty string.