class_docstr: Converts protobuf errors to exceptions and vice versa.
class_docstr_tok: ["Converts","protobuf","errors","to","exceptions","and","vice","versa","."]
docstr: Convert an wandb error to a protobuf error message.
  
  Args:
      exc: The exception to convert.
  
  Returns:
      The corresponding protobuf error message.
docstr_tok: ["Convert","an","wandb","error","to","a","protobuf","error","message",".","Args",":","exc",":","The","exception","to","convert",".","Returns",":","The","corresponding","protobuf","error","message","."]
code: def from_exception(cls, exc: Error) -> "pb.ErrorInfo":
      """Convert an wandb error to a protobuf error message.
  
      Args:
          exc: The exception to convert.
  
      Returns:
          The corresponding protobuf error message.
      """
      if not isinstance(exc, Error):
          raise ValueError(
              "exc must be a subclass of wandb.errors.Error"
          )
  
      code = None
      for subclass in type(exc).__mro__:
          if subclass in from_exception_map:
              code = from_exception_map[subclass]  # type: ignore
              break
      return pb.ErrorInfo(code=code, message=str(exc))
  
imports: from typing import Optional
  from wandb.proto import wandb_internal_pb2
  from .None import AuthenticationError, CommError, Error, UnsupportedError, UsageError
label_desc: Use image node_id 2 for calling the ProtobufErrorHandler obj's underlying member method code with example usage: obj.from_exception(cls, exc) and returns: pb