class_docstr: Interface for defining write-related logic.
  
  If you want to write data to something that isn't built-in, subclass this class
  and call :meth:`~ray.data.Dataset.write_datasink`.
class_docstr_tok: ["Interface","for","defining","write-related","logic",".","If","you","want","to","write","data","to","something","that","is","n't","built-in",",","subclass","this","class","and","call",":","meth",":","`","~ray.data.Dataset.write_datasink","`","."]
docstr: Callback for when a write job fails.
  
  This is called on a best-effort basis on write failures.
  
  Args:
      error: The first error encountered.
docstr_tok: ["Callback","for","when","a","write","job","fails",".","This","is","called","on","a","best-effort","basis","on","write","failures",".","Args",":","error",":","The","first","error","encountered","."]
code: def on_write_failed(self, error: Exception) -> None:
      """Callback for when a write job fails.
  
      This is called on a best-effort basis on write failures.
  
      Args:
          error: The first error encountered.
      """
      pass
  
file_path: ray/python/ray/data/datasource/datasink.py
imports: from typing import Any, Iterable, List
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data.block import Block
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 4 for calling the Datasink obj's underlying member method code with example usage: obj.on_write_failed(error) without return types