Function to get an error message from the object (useful for getting error message in a catch block)
Error object whose message to get
Message of the error - if object has message, returns message. Otherwise tries to stringify
`try {...} catch (e) { logger.info(getErrorMessage(e)) }` Copy
`try {...} catch (e) { logger.info(getErrorMessage(e)) }`
Function to get an error message from the object (useful for getting error message in a catch block)