Created (in Status controller) function getErrorMessage(err)