Add conditional if response received from graph api v1 was empty (#5573)

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
This commit is contained in:
alannnc
2022-11-18 11:41:36 -06:00
committed by GitHub
co-authored by Joe Au-Yeung
parent e7f557f7f9
commit cb96b12108
2 changed files with 5 additions and 0 deletions
@@ -153,6 +153,10 @@ const TeamsVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
const resultObject = JSON.parse(resultString);
if (!resultObject.id || !resultObject.joinUrl) {
throw new HttpError({ statusCode: 500, message: "Error creating MS Teams meeting" });
}
return Promise.resolve({
type: "office365_video",
id: resultObject.id,
+1
View File
@@ -30,6 +30,7 @@ export async function handleErrorsJson<Type>(response: Response): Promise<Type>
export function handleErrorsRaw(response: Response) {
if (response.status === 204) {
console.error({ response });
return "{}";
}
if (!response.ok && response.status < 200 && response.status >= 300) {