Skip to content

Commit

Permalink
fix(functions): Add error message
Browse files Browse the repository at this point in the history
- YouTube getvideoinfo endpoint has been deleted
  • Loading branch information
jacob-ian committed Jun 27, 2021
1 parent 9a1d0d5 commit 98b8342
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,18 @@ exports.getCaptionsList = functions.https.onCall(async (data) => {
`Access to the YouTube API was denied.`
);
default:
throw new functions.https.HttpsError('unknown', 'An error occurred.');
throw new functions.https.HttpsError(
'internal',
`A known error has occurred - I'm working on fixing it right now!`
);
}
}

// Get the readable stream and pipe it into a string
var stream = await res.readable();

// Get the buffer from the stream
try {
// Get the readable stream and pipe it into a string
var stream = await res.readable();
var buffer = await streamToPromise(stream);
// Get the buffer from the stream
} catch {
// Throw an error
throw new functions.https.HttpsError(
Expand Down

0 comments on commit 98b8342

Please sign in to comment.