Skip to content

Commit

Permalink
fix: grammar parsing errors are not reported in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Nov 14, 2023
1 parent 3220b7c commit 4a835bb
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
package org.eclipse.tm4e.core.registry;

import static java.lang.System.Logger.Level.*;
import static org.eclipse.tm4e.core.internal.utils.MoreCollections.*;
import static org.eclipse.tm4e.core.internal.utils.NullSafetyHelper.*;
import static java.lang.System.Logger.Level.WARNING;
import static org.eclipse.tm4e.core.internal.utils.MoreCollections.nullToEmpty;
import static org.eclipse.tm4e.core.internal.utils.NullSafetyHelper.castNonNull;

import java.lang.System.Logger;
import java.util.HashMap;
Expand Down Expand Up @@ -160,8 +160,8 @@ private boolean _doLoadSingleGrammar(final String scopeName) {
final var grammar = RawGrammarReader.readGrammar(grammarSource);
this._syncRegistry.addGrammar(grammar, this._options.getInjections(scopeName));
} catch (final Exception ex) {
LOGGER.log(ERROR, "Loading grammar for scope [{0}] failed: {1}", scopeName, ex.getMessage(), ex);
return false;
throw new TMException("Loading grammar for scope [" + scopeName + "] from [" +
grammarSource.getFilePath() + "] failed: " + ex.getMessage(), ex);
}
return true;
}
Expand All @@ -185,7 +185,7 @@ public IGrammar addGrammar(
this._grammarForScopeName(rawGrammar.getScopeName(), initialLanguage, embeddedLanguages, null, null));

} catch (final Exception ex) {
throw new TMException("Loading grammar from '" + source.getFilePath() + "' failed: " + ex.getMessage(), ex);
throw new TMException("Loading grammar from [" + source.getFilePath() + "] failed: " + ex.getMessage(), ex);
}
}

Expand Down

0 comments on commit 4a835bb

Please sign in to comment.