Skip to content

Commit

Permalink
feat: add method for retrieving id of the video for which transcript …
Browse files Browse the repository at this point in the history
…retrieval has failed
  • Loading branch information
Thoroldvix committed Jun 11, 2024
1 parent f4be13a commit ebd7b4b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class TranscriptRetrievalException extends Exception {

private static final String ERROR_MESSAGE = "Could not retrieve transcript for the video: %s.\nReason: %s";
private static final String YOUTUBE_WATCH_URL = "https://www.youtube.com/watch?v=";
private final String videoId;

/**
* Constructs a new exception with the specified detail message and cause.
Expand All @@ -20,6 +21,7 @@ public class TranscriptRetrievalException extends Exception {
*/
public TranscriptRetrievalException(String videoId, String message, Throwable cause) {
super(buildErrorMessage(videoId, message), cause);
this.videoId = videoId;
}

/**
Expand All @@ -30,6 +32,14 @@ public TranscriptRetrievalException(String videoId, String message, Throwable ca
*/
public TranscriptRetrievalException(String videoId, String message) {
super(buildErrorMessage(videoId, message));
this.videoId = videoId;
}

/**
* @return The ID of the video for which the transcript retrieval failed.
*/
public String getVideoId() {
return videoId;
}

/**
Expand Down

0 comments on commit ebd7b4b

Please sign in to comment.