class_docstr: :class:`.FatalError` is an error thrown by Hail method failures
class_docstr_tok: [":","class",":","`",".FatalError","`","is","an","error","thrown","by","Hail","method","failures"]
code: def maybe_user_error(self, ir) -> Union["FatalError", HailUserError]:
      error_sources = ir.base_search(
          lambda x: x._error_id == self._error_id
      )
      if len(error_sources) == 0:
          return self
  
      better_stack_trace = error_sources[0]._stack_trace
      error_message = str(self)
      message_and_trace = (
          f"{error_message}\n"
          "------------\n"
          "Hail stack trace:\n"
          f"{better_stack_trace}"
      )
      return HailUserError(message_and_trace)
  
imports: from typing import Optional, Union
  import sys
  import re
  from hailtop.config import ConfigVariable, configuration_of
label_desc: Use image node_id 2 for calling the FatalError obj's underlying member method code with example usage: obj.maybe_user_error(ir) and returns: HailUserError, self