code: def get_error_message(exception, context=None, suggestion=None):
      
  
      name, trace = humanise_exception(exception)
  
      problem = m.Message(name)
  
      if exception is None or exception == '':
          problem.append = m.Text(tr('No details provided'))
      else:
          if hasattr(exception, 'message') and \
                  isinstance(exception.message, Message):
              problem.append = m.Text(str(exception.message.message))
          else:
              problem.append = m.Text(str(exception))
  
      suggestion = suggestion
      if suggestion is None and hasattr(exception, 'suggestion'):
          suggestion = exception.suggestion
  
      error_message = ErrorMessage(
          problem,
          detail=context,
          suggestion=suggestion,
          traceback=trace
      )
  
      args = exception.args
      for arg in args:
          error_message.details.append(arg)
  
      return error_message
docs: Convert exception into an ErrorMessage containing a stack trace.
  
      :param exception: Exception object.
      :type exception: Exception
  
      :param context: Optional context message.
      :type context: str
  
      :param suggestion: Optional suggestion.
      :type suggestion: str
  
      .. see also:: https://github.com/inasafe/inasafe/issues/577
  
      :returns: An error message with stack trace info suitable for display.
      :rtype: ErrorMessage