Refactor error handling part 2 (#313)

This commit is contained in:
victor-meng
2020-11-03 13:40:44 -08:00
committed by GitHub
parent a009a8ba5f
commit 5f1f7a8266
58 changed files with 229 additions and 336 deletions

View File

@@ -1,5 +1,6 @@
import * as DataModels from "../Contracts/DataModels";
import * as Logger from "../Common/Logger";
import { getErrorMessage } from "../Common/ErrorHandlingUtils";
interface KernelConnectionMetadata {
name: string;
@@ -78,13 +79,13 @@ export class NotebookConfigurationUtils {
if (!response.ok) {
const responseMessage = await response.json();
Logger.logError(
JSON.stringify(responseMessage),
getErrorMessage(responseMessage),
"NotebookConfigurationUtils/configureServiceEndpoints",
response.status
);
}
} catch (error) {
Logger.logError(error, "NotebookConfigurationUtils/configureServiceEndpoints");
Logger.logError(getErrorMessage(error), "NotebookConfigurationUtils/configureServiceEndpoints");
}
}
}