code: def error_handler(_, event):
      # type: (Any, Any) -> int
      
  
      evt = event.contents
      ERROR.details = {
          "type": evt.type,
          "serial": evt.serial,
          "error_code": evt.error_code,
          "request_code": evt.request_code,
          "minor_code": evt.minor_code,
      }
      return 0
docs: Specifies the program's supplied error handler.