feat: log css errors

This commit is contained in:
Aylur
2023-10-23 02:20:31 +02:00
parent 1c0b049eec
commit da525054e5
+11 -1
View File
@@ -67,7 +67,17 @@ export class App extends Gtk.Application {
}
const cssProvider = new Gtk.CssProvider();
cssProvider.load_from_path(path);
cssProvider.connect('parsing-error', (_, section, err) => {
const file = section.get_file().get_path();
const location = section.get_start_line();
console.error(`CSS ERROR: ${err.message} at line ${location} in ${file}`);
});
try {
cssProvider.load_from_path(path);
} catch (_) {
// log on parsing-error
}
Gtk.StyleContext.add_provider_for_screen(
screen,