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

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
pull/5576/head
alannnc 2022-11-18 11:41:36 -06:00 committed by GitHub
parent e7f557f7f9
commit cb96b12108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -153,6 +153,10 @@ const TeamsVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
const resultObject = JSON.parse(resultString); const resultObject = JSON.parse(resultString);
if (!resultObject.id || !resultObject.joinUrl) {
throw new HttpError({ statusCode: 500, message: "Error creating MS Teams meeting" });
}
return Promise.resolve({ return Promise.resolve({
type: "office365_video", type: "office365_video",
id: resultObject.id, id: resultObject.id,

View File

@ -30,6 +30,7 @@ export async function handleErrorsJson<Type>(response: Response): Promise<Type>
export function handleErrorsRaw(response: Response) { export function handleErrorsRaw(response: Response) {
if (response.status === 204) { if (response.status === 204) {
console.error({ response });
return "{}"; return "{}";
} }
if (!response.ok && response.status < 200 && response.status >= 300) { if (!response.ok && response.status < 200 && response.status >= 300) {