0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added error logging to lexical snippet fix try/catch

no issue

- we had a `catch` with no error logging, it shouldn't be hit but it will be useful to know if it does fail
This commit is contained in:
Kevin Ansfield 2023-06-07 09:56:00 +01:00
parent ef096d9c87
commit abc169329c
No known key found for this signature in database

View file

@ -1,3 +1,4 @@
import * as Sentry from '@sentry/ember';
import ConfirmEditorLeaveModal from '../components/modals/editor/confirm-leave';
import Controller, {inject as controller} from '@ember/controller';
import DeletePostModal from '../components/modals/delete-post';
@ -797,6 +798,16 @@ export default class LexicalEditorController extends Controller {
} catch (e) {
snippet.lexical = null;
snippetFixSaves.push(snippet.save());
console.error(e); // eslint-disable-line no-console
if (this.config.sentry_dsn) {
Sentry.captureException(e, {
tags: {
lexical: true
}
});
}
}
}
});