message: fix: better error handling when the config isn't present
diff: @@ -174,7 +174,7 @@ export class MessageProcessor {
  this._rootPath = configDir
  ? configDir.trim()
  - : params.rootPath || this._rootPath;
  + : params.rootUri || this._rootPath;
  if (!this._rootPath) {
  this._logger.warn(
  'no rootPath configured in extension or server, defaulting to cwd',
  @@ -201,6 +201,7 @@ export class MessageProcessor {
  * Initialize the LSP server when the first file is opened or saved,
  * so that we can access the user settings for config rootDir, etc
  */
  + try {
  if (!this._isInitialized || !this._graphQLCache) {
  if (!this._settings) {
  const settings = await this._connection.workspace.getConfiguration({
  @@ -221,7 +222,9 @@ export class MessageProcessor {
  loadConfigOptions: this._loadConfigOptions,
  config: this._graphQLConfig,
  });
  - this._languageService = new GraphQLLanguageService(this._graphQLCache);
  + this._languageService = new GraphQLLanguageService(
  + this._graphQLCache,
  + );
  if (this._graphQLCache?.getGraphQLConfig) {
  const config = this._graphQLCache.getGraphQLConfig();
  await this._cacheAllProjectFiles(config);
  @@ -232,6 +235,10 @@ export class MessageProcessor {
  return null;
  }
  }
  + } catch (err) {
  + this._logger.error(err);
  + }
  +
  // Here, we set the workspace settings in memory,
  // and re-initialize the language service when a different
  // root path is detected.
  