
class ITunesError(Exception):
    """
    Base exception class for iTunes interface.
    """
    pass

class AppleScriptError(ITunesError):
    """
    Represents an error received from AppleScript while running a script.

    Parameters
    ----------
    message : str
        The message that the exception will hold.
    script : str
        The AppleScript that was running when this exception was raised (default
        "").

    Attributes
    ----------
    script : str
        The AppleScript that was running when this exception was raised, if one
        was provided.
    """

    def __init__(self, message, script=""):

        super(AppleScriptError, self).__init__(message)
        self.script = script


class ITunesError(Exception):
    """
    Base exception class for iTunes interface.
    """
    pass

class AppleScriptError(ITunesError):
    """
    Represents an error received from AppleScript while running a script.

    Parameters
    ----------
    message : str
        The message that the exception will hold.
    script : str
        The AppleScript that was running when this exception was raised (default
        "").

    Attributes
    ----------
    script : str
        The AppleScript that was running when this exception was raised, if one
        was provided.
    """

    def __init__(self, message, script=""):

        super(AppleScriptError, self).__init__(message)
        self.script = script

class TrackError(ITunesError):
    """
    Represents an error in finding or playing a track.

    Parameters
    ----------
    message : str
        The message that the exception will hold.
    title : str
        The title of the track that caused the error (default "").

    Attributes
    ----------
    title : str
        The title of the track that caused the error.
    """

    def __init__(self, message, title=""):

        super(TrackError, self).__init__(message)
        self.title = title

Add custom exception for track-related errors
Add custom exception for track-related errors

The new exception type (`TrackError`) will be used when a track cannot
be played or found.

  
  class ITunesError(Exception):
      """
      Base exception class for iTunes interface.
      """
      pass
  
  class AppleScriptError(ITunesError):
      """
      Represents an error received from AppleScript while running a script.
  
      Parameters
      ----------
      message : str
          The message that the exception will hold.
      script : str
          The AppleScript that was running when this exception was raised (default
          "").
  
      Attributes
      ----------
      script : str
          The AppleScript that was running when this exception was raised, if one
          was provided.
      """
  
      def __init__(self, message, script=""):
  
          super(AppleScriptError, self).__init__(message)
          self.script = script
  
+ class TrackError(ITunesError):
+     """
+     Represents an error in finding or playing a track.
+ 
+     Parameters
+     ----------
+     message : str
+         The message that the exception will hold.
+     title : str
+         The title of the track that caused the error (default "").
+ 
+     Attributes
+     ----------
+     title : str
+         The title of the track that caused the error.
+     """
+ 
+     def __init__(self, message, title=""):
+ 
+         super(TrackError, self).__init__(message)
+         self.title = title
+ 
Add custom exception for track-related errors
## Code Before:

class ITunesError(Exception):
    """
    Base exception class for iTunes interface.
    """
    pass

class AppleScriptError(ITunesError):
    """
    Represents an error received from AppleScript while running a script.

    Parameters
    ----------
    message : str
        The message that the exception will hold.
    script : str
        The AppleScript that was running when this exception was raised (default
        "").

    Attributes
    ----------
    script : str
        The AppleScript that was running when this exception was raised, if one
        was provided.
    """

    def __init__(self, message, script=""):

        super(AppleScriptError, self).__init__(message)
        self.script = script

## Instruction:
Add custom exception for track-related errors
## Code After:

class ITunesError(Exception):
    """
    Base exception class for iTunes interface.
    """
    pass

class AppleScriptError(ITunesError):
    """
    Represents an error received from AppleScript while running a script.

    Parameters
    ----------
    message : str
        The message that the exception will hold.
    script : str
        The AppleScript that was running when this exception was raised (default
        "").

    Attributes
    ----------
    script : str
        The AppleScript that was running when this exception was raised, if one
        was provided.
    """

    def __init__(self, message, script=""):

        super(AppleScriptError, self).__init__(message)
        self.script = script

class TrackError(ITunesError):
    """
    Represents an error in finding or playing a track.

    Parameters
    ----------
    message : str
        The message that the exception will hold.
    title : str
        The title of the track that caused the error (default "").

    Attributes
    ----------
    title : str
        The title of the track that caused the error.
    """

    def __init__(self, message, title=""):

        super(TrackError, self).__init__(message)
        self.title = title
